Browse Source

Fixed navigation to mapage

Jeroen 10 years ago
parent
commit
572402e8e1

+ 1 - 1
Breda-Tour/Data/Gps.cs

@@ -42,7 +42,7 @@ namespace Breda_Tour.Data
             switch (accessStatus)
             switch (accessStatus)
             {
             {
                 case GeolocationAccessStatus.Allowed:
                 case GeolocationAccessStatus.Allowed:
-                    geolocator = new Geolocator { DesiredAccuracyInMeters = 1, MovementThreshold = 2 };
+                    geolocator = new Geolocator { DesiredAccuracyInMeters = 5, MovementThreshold = 2 };
                     // Subscribe events
                     // Subscribe events
                     geolocator.StatusChanged += OnStatusChanged;
                     geolocator.StatusChanged += OnStatusChanged;
                     geolocator.PositionChanged += OnPositionChanged;
                     geolocator.PositionChanged += OnPositionChanged;

+ 4 - 1
Breda-Tour/MapScreen/MapPage.xaml.cs

@@ -54,7 +54,10 @@ namespace Breda_Tour.MapScreen
         {
         {
             SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
             SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
             DefaultPivot.SetCheckedButton(DefaultPivotControl.Tab.Map);
             DefaultPivot.SetCheckedButton(DefaultPivotControl.Tab.Map);
-            //route = e.Parameter as Route;
+            if (this.route == null)
+            {
+                route = e.Parameter as Route;
+            }
         }
         }
 
 
         public async void ShowLocaton(Geopoint point)
         public async void ShowLocaton(Geopoint point)

+ 5 - 3
Breda-Tour/RouteSelectScreen/RouteExample.xaml

@@ -9,14 +9,16 @@
     xmlns:data="using:Breda_Tour.Data"
     xmlns:data="using:Breda_Tour.Data"
     mc:Ignorable="d">
     mc:Ignorable="d">
 
 
-    <Grid>
+    <Grid Background="White">
         <c:DefaultTopBar Header="Routevoorbeeld" Margin="0,-300,0,300"/>
         <c:DefaultTopBar Header="Routevoorbeeld" Margin="0,-300,0,300"/>
         <TextBlock Text="Routeinformatie" FontSize="16" Margin="17,45,0,-23"/>
         <TextBlock Text="Routeinformatie" FontSize="16" Margin="17,45,0,-23"/>
         <TextBlock Text="Tijdsduur: " FontSize="16" Margin="17,80,0,-25"/>
         <TextBlock Text="Tijdsduur: " FontSize="16" Margin="17,80,0,-25"/>
         <TextBlock Text="Loopafstand: " FontSize="16" Margin="17,95,0,-25"/>
         <TextBlock Text="Loopafstand: " FontSize="16" Margin="17,95,0,-25"/>
         <TextBlock Text="{x:Bind WaypointsText}" FontSize="16" Margin="17,110,0,-25"/>
         <TextBlock Text="{x:Bind WaypointsText}" FontSize="16" Margin="17,110,0,-25"/>
-        <Button Click="Button_Click" Margin="200,139,0,489"/>
-        <ListView x:Name="Waypoints" ItemsSource="{x:Bind route.Waypoints}" Margin="0,328,0,0">
+        <Button Visibility="Visible" Click="Button_Click" >
+            <TextBlock Text="Kappa Button"/>
+        </Button>
+            <ListView x:Name="Waypoints" ItemsSource="{x:Bind route.Waypoints}" Margin="0,328,0,0">
             <ListView.ItemContainerStyle>
             <ListView.ItemContainerStyle>
                 <Style TargetType="ListViewItem">
                 <Style TargetType="ListViewItem">
                     <Setter Property="Padding" Value="0"/>
                     <Setter Property="Padding" Value="0"/>

+ 7 - 2
Breda-Tour/RouteSelectScreen/RouteExample.xaml.cs

@@ -14,6 +14,7 @@ using Windows.UI.Xaml.Data;
 using Windows.UI.Xaml.Input;
 using Windows.UI.Xaml.Input;
 using Windows.UI.Xaml.Media;
 using Windows.UI.Xaml.Media;
 using Windows.UI.Xaml.Navigation;
 using Windows.UI.Xaml.Navigation;
+using Breda_Tour.MapScreen;
 
 
 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
 
 
@@ -43,8 +44,12 @@ namespace Breda_Tour.RouteSelectScreen
 
 
         private void Button_Click(object sender, RoutedEventArgs e)
         private void Button_Click(object sender, RoutedEventArgs e)
         {
         {
-            Frame frame = Window.Current.Content as Frame;
-            //frame.Navigate(typeof(MapPage), route);
+            MainPage.RootFrame.Navigate(typeof(MapPage),route);
+        }
+
+        private void ShowRouteInfo()
+        {
+            
         }
         }
     }
     }
 }
 }

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

@@ -35,8 +35,7 @@ namespace Breda_Tour.RouteSelectScreen
         private void Routes_ItemClick(object sender, ItemClickEventArgs e)
         private void Routes_ItemClick(object sender, ItemClickEventArgs e)
         {
         {
             Route route = e.ClickedItem as Route;
             Route route = e.ClickedItem as Route;
-            Frame frame = Window.Current.Content as Frame;
-            frame.Navigate(typeof(RouteExample), route);
+            MainPage.RootFrame.Navigate(typeof (RouteExample), route);
         }
         }
     }
     }
-}
+}

+ 1 - 1
Breda-Tour/project.lock.json

@@ -11523,7 +11523,7 @@
       ]
       ]
     },
     },
     "Microsoft.ApplicationInsights.WindowsApps/1.0.0": {
     "Microsoft.ApplicationInsights.WindowsApps/1.0.0": {
-      "sha512": "NvBQnFeiFd0O1QdBz06UGApD7zn7ztVi7qO18IsM3EjiXRNgfrEBXB+azNm8XqLY8xGFAqh3HAuSd/wHZMe0XA==",
+      "sha512": "fNCAjIwvbTV+G0dT14bgM5tptsqeSaKQaCrlq7QknOq1Xdm8ZmgsDYddMgXkvykyKLjWyU6fKuOpj6fsQJy+wQ==",
       "type": "Package",
       "type": "Package",
       "files": [
       "files": [
         "[Content_Types].xml",
         "[Content_Types].xml",