PageRenderTime 35ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/Visual Studio 2008/CSWPFNavigationUsage/Page1.xaml.cs

#
C# | 38 lines | 29 code | 1 blank | 8 comment | 0 complexity | c7cbcdc68bfc2d1f7c0dc931a620cdc2 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Navigation;
  13. using System.Windows.Shapes;
  14. namespace CSWPFNavigationUsage
  15. {
  16. /// <summary>
  17. /// Interaction logic for Page1.xaml
  18. /// </summary>
  19. public partial class Page1 : Page
  20. {
  21. public Page1()
  22. {
  23. InitializeComponent();
  24. // Get a reference to the NavigationService that navigated to this Page
  25. NavigationService ns = NavigationService.GetNavigationService(this);
  26. }
  27. void hyperlink_Click(object sender, RoutedEventArgs e)
  28. {
  29. // Create a pack URI
  30. Uri uri = new Uri("AnotherPage.xaml", UriKind.Relative);
  31. // Get the navigation service that was used to
  32. // navigate to this page, and navigate to
  33. // AnotherPage.xaml
  34. this.NavigationService.Navigate(uri);
  35. }
  36. }
  37. }