Эх сурвалжийг харах

Fixed Route draw and horizontal image viewing (reverted from commit 02c7393d2af767970b6921370afedfc44e426d97)

Jeroen 10 жил өмнө
parent
commit
d6f9c2019a

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

@@ -53,8 +53,6 @@ namespace Breda_Tour.MapScreen
             route = routeDB.Routes.ElementAt(0);
             this.InitializeComponent();
             Debug.Write("New Map generated");
-            ShowWaypoints(route);
-            ShowRoute(route);
         }
 
         protected override void OnNavigatedTo(NavigationEventArgs e)
@@ -63,6 +61,8 @@ namespace Breda_Tour.MapScreen
             DefaultPivot.SetCheckedButton(DefaultPivotControl.Tab.Map);
         }
 
+
+
         public async void ShowLocaton(Geopoint point)
         {
             this.point = point;
@@ -76,11 +76,13 @@ namespace Breda_Tour.MapScreen
                marker.Location = point;
            });
             await Map.TrySetViewAsync(point, 17);
+            ShowWaypoints(route);
+            ShowRoute(route);
         }
 
         public async void ShowRoute(Route route)
         {
-            await Dispatcher.RunAsync(CoreDispatcherPriority.High, async () =>
+            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
             {
                 List<Geopoint> geopoints = new List<Geopoint>();
                 foreach (Waypoint wayPoint in route.Waypoints)
@@ -100,7 +102,7 @@ namespace Breda_Tour.MapScreen
 
         public async void ShowWaypoints(Route route)
         {
-            await Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
+            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
             {
                 for (int x = 0; x < route.Waypoints.Count; x++)
                 {

+ 5 - 10
Breda-Tour/MapScreen/WpDetailPage.xaml

@@ -24,18 +24,13 @@
                     ScrollViewer.VerticalScrollMode="Disabled" HorizontalAlignment="Left" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
             <ListView.ItemsPanel>
                 <ItemsPanelTemplate>
-                    <StackPanel Orientation="Horizontal" Padding="0"/>
+                    <StackPanel Orientation="Horizontal"/>
                 </ItemsPanelTemplate>
             </ListView.ItemsPanel>
             <ListView.ItemTemplate >
                 <DataTemplate x:DataType="data:Picture">
-                     <ListViewItem Padding="0">
-                        <Canvas Height="170"  Width="170" HorizontalAlignment="Center" VerticalAlignment="Center">
-                            <Canvas.Background>
-                                <ImageBrush />
-                            </Canvas.Background>
-                            <Image Tapped="Image_PointerPressed" Source="{x:Bind Source}"  Width="170" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-                        </Canvas>
+                    <ListViewItem>
+                        <Image Source="{x:Bind Source}" Height="{x:Bind Width}" Width="{x:Bind Width}" Stretch="UniformToFill" />
                     </ListViewItem>
                 </DataTemplate>
             </ListView.ItemTemplate>
@@ -44,9 +39,9 @@
             <TextBlock Text="Beschrijving" FontSize="20" Margin="15,15,0,15" />
         </RelativePanel>
         <RelativePanel Grid.Row="3">
-            <ScrollViewer Margin="15,0,0,0" VerticalScrollBarVisibility="Auto" >
+           <ScrollViewer Margin="15,0,0,0" VerticalScrollBarVisibility="Auto" >
                 <TextBlock HorizontalAlignment="Stretch"  VerticalAlignment="Stretch" TextWrapping="Wrap" Text="{x:Bind wp.Description}"/>
-            </ScrollViewer>
+           </ScrollViewer>
         </RelativePanel>
     </Grid>
 </Page>