WpDetailPage.xaml.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Runtime.InteropServices.WindowsRuntime;
  6. using Windows.Foundation;
  7. using Windows.Foundation.Collections;
  8. using Windows.UI.Core;
  9. using Windows.UI.Xaml;
  10. using Windows.UI.Xaml.Controls;
  11. using Windows.UI.Xaml.Controls.Primitives;
  12. using Windows.UI.Xaml.Data;
  13. using Windows.UI.Xaml.Input;
  14. using Windows.UI.Xaml.Media;
  15. using Windows.UI.Xaml.Navigation;
  16. using Breda_Tour.Data_;
  17. // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
  18. namespace Breda_Tour.MapScreen
  19. {
  20. /// <summary>
  21. /// An empty page that can be used on its own or navigated to within a Frame.
  22. /// </summary>
  23. public sealed partial class WpDetailPage : Page
  24. {
  25. private WayPoint wp;
  26. public WpDetailPage()
  27. {
  28. this.InitializeComponent();
  29. }
  30. protected override void OnNavigatedTo(NavigationEventArgs e)
  31. {
  32. wp = e.Parameter as WayPoint;
  33. this.DataContext = wp;
  34. SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
  35. SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested;
  36. }
  37. private void MainPage_BackRequested(object sender, BackRequestedEventArgs e)
  38. {
  39. e.Handled = true;
  40. SystemNavigationManager.GetForCurrentView().BackRequested -= MainPage_BackRequested;
  41. MainPage.RootFrame.Navigate(typeof (MapPage));
  42. }
  43. }
  44. }