I am posting as a new question because I believe I have narrowed the issue down to a ResourceDictionary problem, and I decided that this new information would never be seen.
The basic issue is that I have a WPF project that works fine when set as the default startup project, but if I try to call it from another application (Windows Tray app), some of the data does not display correctly. These two applications are in separate projects but the same solution.
When I set the WPF up as the default startup project, the ResourceDictionary is loaded from App.xaml. However, when I run the Tray, and start the WPF window through code, the App.xaml is never called.
In App.xaml, a ResourceDictionary is defined:
<Application x:Class="MRS.Sender_Receiver.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Shell.xaml">
<Application.Resources>
<ResourceDictionary Source="Themes\Generic.xaml"/>
</Application.Resources>
</Application>
This resource is not loaded when called from the Tray:
private void settingsEvent_Click(object sender, EventArgs e)
{
gui = new MRS.Sender_Receiver.mainWindow(); // mainWindow() is located in Shell.xaml.
gui.Show();
}
Does anyone have an idea of how I can call a WPF application from another application, and have it load the ResourceDictionary when it is not using App.xaml? In other words, I need to set the dictionary either in Shell.xaml or in code-behind somewhere.
Thanks.

New Topic/Question
Reply



MultiQuote



|