I have a WPF application.
The page that opens when the app runs in MainWindow.xaml
, as set in the StartupUri attribute of the App.xaml
file. This page opens fine.
However, if I try to open any other windows using the Show or ShowDialog method I get an IOException
in the InitializeComponent
method saying "Cannot locate resource 'Window1.xaml'"
(or whatever the file is called). This happens with every single window I create. I've searched online but all the solutions seem to say "make sure the StartupUri attribute of the App.xaml is correct" and mine is, hence MainWindow opening.
Any idea what's going on?