private void On_Click(object sender, RoutedEventArgs e) { if (sender == simplexaml) { displayFrame.Navigate(new System.Uri("Page1.xaml", UriKind.RelativeOrAbsolute)); } else if (sender == simpleobject) { Page1 nextPage = new Page1(); nextPage.InitializeComponent(); displayFrame.Navigate(nextPage); } else if (sender == frames) { displayFrame.Navigate(new System.Uri("Page2.xaml", UriKind.RelativeOrAbsolute)); } else if (sender == large) { displayFrame.Navigate(new System.Uri("Content.xaml", UriKind.RelativeOrAbsolute)); } else if (sender == fragment) { displayFrame.Navigate(new System.Uri("content.xaml#SomeTarget", UriKind.RelativeOrAbsolute)); } else if (sender == forward) { if (navWindow.CanGoForward) { navWindow.GoForward(); } else { MessageBox.Show("Nothing in the Forward stack"); } } else if (sender == back) { if (navWindow.CanGoBack) { navWindow.GoBack(); } else { MessageBox.Show("Nothing in the Back stack"); } } else if (sender == stop) { navWindow.StopLoading(); } else if (sender == refresh) { navWindow.Refresh(); } }
/// <summary> /// Navigates forward. /// </summary> public void GoForward() { _window.GoForward(); }