Loading page in WPF Loading page in WPF wpf wpf

Loading page in WPF


I came here to add that there are many ways to load the pages into the frame:

By setting the source (as @Shift mentioned)

frame1.Source = new Uri("Page1.xaml", UriKind.RelativeOrAbsolute);

By setting the Content:

frame1.Content= new Page1();

By using the NavigationService:

frame1.NavigationService.Navigate(new Page1());


Adding a frame and setting the source for the frame like makes my day :)

frame1.Source = new Uri("Page1.xaml", UriKind.RelativeOrAbsolute);


You can add a frame to your main page and load the pages on it.