PageRenderTime 69ms CodeModel.GetById 38ms RepoModel.GetById 0ms app.codeStats 1ms

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

#
C# | 46 lines | 41 code | 5 blank | 0 comment | 0 complexity | 444a9686ea81e3a24a98700249e9718a 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.Shapes;
  13. using System.Windows.Navigation;
  14. namespace CSWPFNavigationUsage
  15. {
  16. public partial class MainPage : Page
  17. {
  18. public MainPage()
  19. {
  20. InitializeComponent();
  21. }
  22. private void OnHyperlink(object sender, RoutedEventArgs e)
  23. {
  24. this.NavigationService.Navigate(new Uri("Page1.xaml", UriKind.Relative));
  25. }
  26. private void OnNavagateToObject(object sender, RoutedEventArgs e)
  27. {
  28. MyDummy obj = new MyDummy() { Property1 = "Hello", Property2 = "everyone" };
  29. this.NavigationService.Navigate(obj);
  30. }
  31. private void OnNavagateToPage(object sender, RoutedEventArgs e)
  32. {
  33. this.NavigationService.Navigate(new Uri("FramePage.xaml", UriKind.Relative));
  34. }
  35. }
  36. public class MyDummy
  37. {
  38. public string Property1 { get; set; }
  39. public string Property2 { get; set; }
  40. }
  41. }