Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Opening WPF-window in project 1 from project 2 results in project 1 using project 2's application resources

$
0
0

Inside my solution I have a WPF-project called Host which is the start up-project and acts as a shell for other WPF-projects.

Inside Host I open a window from another project like this: 

Host.Content.AnotherWPFApp.MainWindow window = new Host.Content.AnotherWPFApp.MainWindow();

window.Show();

The thing here is that the AnotherWPFApp-project uses the resource dictionaries defined in Host's App.xaml during runtime but its own when in design-mode. When I set AnotherWPFApp as startup project and run it directly (without launching it from Host) it uses its own App.xaml.

Maybe I should also mention that the resource dictionaries are defined in a 3rd project which both Host and AnotherWPFApp has a reference to.



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>