usefulBee
usefulBee

Reputation: 9702

How to Open a XAML Window from another Project?

I added a new WPF project to the solution and was just wondering how trigger the other project/XAML Window to start when needed. I added all projects references required. I understand that switching XAMLs is easy within one project, for example change StartupUri="MainWindow.xaml". But a XAML from another project?!

Upvotes: 1

Views: 1191

Answers (1)

Anatolii Gabuza
Anatolii Gabuza

Reputation: 6260

You can do it in the same manner. Key here is in relative uri type:

this.StartupUri = new System.Uri("/someOtherAssembly;component/NewMainWindow.xaml, UriKind.Relative);

Upvotes: 1

Related Questions