Working with Pages in WPF

WPF

Here are a few thing to remember when working with pages:

To set a start page instead of a window, edit app.xaml and set the page as startup Uri

To set the startup location of the page, edit app.xaml, register to LoadCompleted and then do this:

this.MainWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;

To navigate between pages, use the NavigationSource:


NavigationService navigationService = NavigationService.GetNavigationService(this);
navigationService.Navigate(new Uri("/NextPage.xaml", UriKind.Relative));

Post a Comment

Previous Post Next Post