IM not a C# programmer by nature but I do ok with it for what i need. Im trying to Learn WPF and my question is, Can I Declare my classes in App.xaml and access it from all of my separate controls? Im primarily interested in this because I would like ot be about to have one LogWriter and let all of them talk to it.
<!-- App.xaml -->
<Application x:Class="MyAPP.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:LogWriter"
StartupUri="MainWindow.xaml">
<Application.Resources>
<src:LogWriter x:Name="LogWriter"/>
</Application.Resources>
</Application>
Set
x:Key, useStaticResourceto reference.Application.Resourcesare accessible anywhere in the application.