Selaa lähdekoodia

routeSelectPage & RouteExample verder afgemaakt

guusvdongen 10 vuotta sitten
vanhempi
commit
2bde14bd9c

BIN
Breda-Tour/Assets/Flag_Icon.png


BIN
Breda-Tour/Assets/Map_Icon.png


BIN
Breda-Tour/Assets/UitklapIcon1.png


+ 3 - 0
Breda-Tour/Breda-Tour.csproj

@@ -94,6 +94,9 @@
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     <None Include="project.json" />
+    <Content Include="Assets\Flag_Icon.png" />
+    <Content Include="Assets\Map_Icon.png" />
+    <Content Include="Assets\UitklapIcon1.png" />
     <Content Include="Storage\Routes\routes.json">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

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

@@ -9,12 +9,27 @@
     xmlns:data="using:Breda_Tour.Data"
     mc:Ignorable="d">
 
-    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
+    <Grid>
         <c:DefaultTopBar Header="Routevoorbeeld" Margin="0,-300,0,300"/>
         <TextBlock Text="Routeinformatie" FontSize="16" Margin="17,45,0,-23"/>
-
         <TextBlock Text="Tijdsduur: " FontSize="16" Margin="17,80,0,-25"/>
         <TextBlock Text="Loopafstand: " FontSize="16" Margin="17,95,0,-25"/>
-        <TextBlock Text="{x:Bind Waypoints}" 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">
+            <ListView.ItemContainerStyle>
+                <Style TargetType="ListViewItem">
+                    <Setter Property="Padding" Value="0"/>
+                    <Setter Property="Margin" Value="0"/>
+                </Style>
+            </ListView.ItemContainerStyle>
+            <ListView.ItemTemplate>
+                <DataTemplate x:DataType="data:Waypoint">
+                    <StackPanel>
+                        <TextBlock Text="{Binding Title}" Margin="10,0,0,0"/>
+                    </StackPanel>
+                </DataTemplate>
+            </ListView.ItemTemplate>
+        </ListView>
     </Grid>
 </Page>

+ 9 - 3
Breda-Tour/RouteSelectScreen/RouteExample.xaml.cs

@@ -25,7 +25,7 @@ namespace Breda_Tour.RouteSelectScreen
     public sealed partial class RouteExample : Page
     {
         Route route;
-        public string Waypoints { get; set; } 
+        public string WaypointsText { get; set; } 
 
         public RouteExample()
         {
@@ -35,10 +35,16 @@ namespace Breda_Tour.RouteSelectScreen
         protected override void OnNavigatedTo(NavigationEventArgs e)
         {
             route = e.Parameter as Route;
-            Waypoints = "Aantal waypoints: " + 0;
+            WaypointsText = "Aantal waypoints: " + 0;
             if (route.Waypoints.Count != 0){
-                Waypoints = "Aantal waypoints: " +route.Waypoints.Count;
+                WaypointsText = "Aantal waypoints: " +route.Waypoints.Count;
             }
         }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            Frame frame = Window.Current.Content as Frame;
+            //frame.Navigate(typeof(MapPage), route);
+        }
     }
 }

+ 7 - 4
Breda-Tour/RouteSelectScreen/RouteSelectPage.xaml

@@ -28,14 +28,17 @@
                     <DataTemplate x:DataType="data:Route">
                         <StackPanel>
                             <StackPanel Orientation="Horizontal" Width="340">
-                                <TextBlock Text="{Binding Title}" FontSize="24"/>
-                                <ToggleButton x:Name="toggleButton" Content="" IsChecked="False"/>
+                                <Image Source="ms-appx:///Assets/Map_Icon.png" Width="35" Height="35"/>
+                                <TextBlock Text="{Binding Title}" FontSize="24" Margin="15,0,0,0"/>
+                                <ToggleButton x:Name="toggleButton" IsChecked="False"  Margin="35,0,0,0">
+                                </ToggleButton>
                             </StackPanel>
                             <StackPanel Orientation="Horizontal" Width="340" Visibility="{Binding Path=IsChecked, ElementName=toggleButton,Converter={StaticResource BoolToVis}}">
-                                <TextBlock Text="Breda" FontSize="16"/>      
+                                <Image Source="ms-appx:///Assets/Flag_Icon.png" Width="25" Height="25" Margin="45,0,0,0"/>
+                                <TextBlock Text="Breda" Foreground="DarkGray" FontSize="16" Margin="15,0,0,0"/>
                             </StackPanel>
+                            <Line X1="0" X2="1080" Y1="5" Y2="5" Stroke="Gray" StrokeThickness="2"/>
                         </StackPanel>
-                        
                     </DataTemplate>
                 </ListView.ItemTemplate>
             </ListView>

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

@@ -24,6 +24,7 @@ namespace Breda_Tour.RouteSelectScreen
     public sealed partial class RouteSelectPage : Page
     {
         RouteDatabase AllRoutes;
+
         public RouteSelectPage()
         {
             AllRoutes = new RouteDatabase();