Quellcode durchsuchen

Fixed Route draw and horizontal image viewing

Jeroen vor 10 Jahren
Ursprung
Commit
02c7393d2a
2 geänderte Dateien mit 12 neuen und 10 gelöschten Zeilen
  1. 4 6
      Breda-Tour/MapScreen/MapPage.xaml.cs
  2. 8 4
      Breda-Tour/MapScreen/WpDetailPage.xaml

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

@@ -53,6 +53,8 @@ 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)
@@ -61,8 +63,6 @@ namespace Breda_Tour.MapScreen
             DefaultPivot.SetCheckedButton(DefaultPivotControl.Tab.Map);
         }
 
-
-
         public async void ShowLocaton(Geopoint point)
         {
             this.point = point;
@@ -76,13 +76,11 @@ 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.Normal, async () =>
+            await Dispatcher.RunAsync(CoreDispatcherPriority.High, async () =>
             {
                 List<Geopoint> geopoints = new List<Geopoint>();
                 foreach (Waypoint wayPoint in route.Waypoints)
@@ -102,7 +100,7 @@ namespace Breda_Tour.MapScreen
 
         public async void ShowWaypoints(Route route)
         {
-            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+            await Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
             {
                 for (int x = 0; x < route.Waypoints.Count; x++)
                 {

+ 8 - 4
Breda-Tour/MapScreen/WpDetailPage.xaml

@@ -18,10 +18,14 @@
         </Grid.RowDefinitions>
 
         <c:DefaultTopBar x:Name="NameBar" Grid.Row="0" Header="{x:Bind wp.Title}"/>
-        <ListView Grid.Row="1" ItemsSource="{x:Bind wp.Pictures}">
+        <ListView Grid.Row="1" ItemsSource="{x:Bind wp.Pictures}"
+                  ScrollViewer.HorizontalScrollMode="Enabled"
+                    ScrollViewer.HorizontalScrollBarVisibility="Visible"
+                    ScrollViewer.IsHorizontalRailEnabled="True"
+                    ScrollViewer.VerticalScrollMode="Disabled">
             <ListView.ItemsPanel>
                 <ItemsPanelTemplate>
-                    <StackPanel Orientation="Horizontal"/>
+                    <StackPanel Orientation="Horizontal" Padding="0"/>
                 </ItemsPanelTemplate>
             </ListView.ItemsPanel>
             <ListView.ItemTemplate >
@@ -36,9 +40,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>