RouteSelectPage.xaml.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Breda_Tour.Data;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Runtime.InteropServices.WindowsRuntime;
  8. using Windows.Foundation;
  9. using Windows.Foundation.Collections;
  10. using Windows.UI.Core;
  11. using Windows.UI.Xaml;
  12. using Windows.UI.Xaml.Controls;
  13. using Windows.UI.Xaml.Controls.Primitives;
  14. using Windows.UI.Xaml.Data;
  15. using Windows.UI.Xaml.Input;
  16. using Windows.UI.Xaml.Media;
  17. using Windows.UI.Xaml.Navigation;
  18. // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
  19. namespace Breda_Tour.RouteSelectScreen
  20. {
  21. /// <summary>
  22. /// An empty page that can be used on its own or navigated to within a Frame.
  23. /// </summary>
  24. public sealed partial class RouteSelectPage : Page
  25. {
  26. RouteDatabase AllRoutes;
  27. ObservableCollection<Route> CurrentRoutes;
  28. public RouteSelectPage()
  29. {
  30. AllRoutes = new RouteDatabase();
  31. this.InitializeComponent();
  32. DefaultPivot.SetCheckedButton(CustomControls.DefaultPivotControl.Tab.RouteSelected);
  33. }
  34. protected override void OnNavigatedTo(NavigationEventArgs e)
  35. {
  36. SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
  37. CurrentRoutes = AllRoutes.GetCurrentRoutes();
  38. System.Diagnostics.Debug.WriteLine(CurrentRoutes[0].Language);
  39. }
  40. private void Routes_ItemClick(object sender, ItemClickEventArgs e)
  41. {
  42. Route route = e.ClickedItem as Route;
  43. MainPage.RootFrame.Navigate(typeof (RouteExample), route);
  44. }
  45. }
  46. }