Sunday, 28 July 2013

Set default Window / Page - WPF Application

The default page to be loaded in a WPF application is configured in App.xaml file.
By default the project will have App.xaml file as below:

<Application x:Class="Login_WPF.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml">
   <Application.Resources></Application.Resources>
</Application>
Here MainWindow.xaml is the default window set by visual studio.
If you want to change the startup window of the WPF app to MyWindow.xaml, update with this xaml file name as below.
<Application x:Class="Login_WPF.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MyWindow.xaml">
   <Application.Resources></Application.Resources>
</Application>

No comments:

Post a Comment