WpDetailPage.xaml.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. private void Image_PointerPressed(object sender, TappedRoutedEventArgs e)
  44. {
  45. Image i = (Image)sender;
  46. MainPage.RootFrame.Navigate(typeof(ImageViewPage), new Tuple<ImageSource, Waypoint>(i.Source, wp));
  47. }
  48. private void Image_Tapped(object sender, TappedRoutedEventArgs e)
  49. {
  50. }
  51. }
  52. }