Browse Source

final commit vanuit mijn kant

Bart Reedijk 10 năm trước cách đây
mục cha
commit
e95cba7410

+ 1 - 1
Breda-Tour/RouteSelectScreen/RouteSelectPage.xaml

@@ -8,7 +8,7 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:data="using:Breda_Tour.Data"
     xmlns:con="using:Breda_Tour.RouteSelectScreen"
-    mc:Ignorable="d">
+    mc:Ignorable="d" GotFocus="Page_GotFocus">
 
 
     <Grid>

+ 15 - 2
Breda-Tour/RouteSelectScreen/RouteSelectPage.xaml.cs

@@ -26,11 +26,19 @@ namespace Breda_Tour.RouteSelectScreen
     public sealed partial class RouteSelectPage : Page
     {
         RouteDatabase AllRoutes;
-        ObservableCollection<Route> CurrentRoutes;
+
+        public ObservableCollection<Route> CurrentRoutes
+        {
+            get { return (ObservableCollection<Route>)GetValue(HelpItemProperty); }
+            set { SetValue(HelpItemProperty, value); }
+        }
+        public static readonly DependencyProperty HelpItemProperty =
+        DependencyProperty.Register("CurrentRoutes", typeof(ObservableCollection<Route>), typeof(RouteSelectPage), null);
 
         public RouteSelectPage()
         {
             AllRoutes = new RouteDatabase();
+            CurrentRoutes = AllRoutes.GetCurrentRoutes();
             this.InitializeComponent();
             DefaultPivot.SetCheckedButton(CustomControls.DefaultPivotControl.Tab.RouteSelected);
         }
@@ -44,7 +52,12 @@ namespace Breda_Tour.RouteSelectScreen
         private void Routes_ItemClick(object sender, ItemClickEventArgs e)
         {
             Route route = e.ClickedItem as Route;
-            MainPage.RootFrame.Navigate(typeof (RouteExample), route);
+            MainPage.RootFrame.Navigate(typeof(RouteExample), route);
+        }
+
+        private void Page_GotFocus(object sender, RoutedEventArgs e)
+        {
+            CurrentRoutes = AllRoutes.GetCurrentRoutes();
         }
     }
 }