2
votes

I have created one MVVM sample application. My solution structure is like I have 4 folders. 1st for Model, 2nd for View, 3rd for ViewModel, and 4th for HelperClasses. Currently I have only one view in View folder. I want to set my view [say FamilyView, present in View folder] in StartupUri in App.xaml file, which is by default set to MainWindow.xaml.

I don't want to set the startup in App.Xaml.cs.

Please suggest how to do that?

Also, can you please suggest how to change view in App.Xaml file only, if having more than one view.

1
You don't want to set the StartupUri in App.xaml, or you do ?Sherlock

1 Answers

8
votes

I'm not exactly sure what you're asking. If your StartupUri is in another namespace then you have to specify which namespace it is in like this

StartupUri="Windows\LoginWindow.xaml">

You go on to say that you don't want to set the StartupUri in App.xaml. You can do this programmatically by overriding the OnStartup method. Take a look at this link for more details.