Sfoglia il codice sorgente

RouteSelect aangepast

guusvdongen 10 anni fa
parent
commit
d109ce2772

+ 33 - 0
Breda-Tour/RouteSelectScreen/Converter.cs

@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Data;
+
+namespace Breda_Tour.RouteSelectScreen
+{
+    class Converter :IValueConverter
+    {
+        private object GetVisibility(object value)
+        {
+            if (!(value is bool))
+                return Visibility.Collapsed;
+            bool objValue = (bool)value;
+            if (objValue)
+            {
+                return Visibility.Visible;
+            }
+            return Visibility.Collapsed;
+        }
+        public object Convert(object value, Type targetType, object parameter, string language)
+        {
+            return GetVisibility(value);
+        }
+        public object ConvertBack(object value, Type targetType, object parameter, string language)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 20 - 0
Breda-Tour/RouteSelectScreen/RouteExample.xaml

@@ -0,0 +1,20 @@
+<Page
+    x:Class="Breda_Tour.RouteSelectScreen.RouteExample"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="using:Breda_Tour.RouteSelectScreen"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:c="using:Breda_Tour.CustomControls"
+    xmlns:data="using:Breda_Tour.Data"
+    mc:Ignorable="d">
+
+    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
+        <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="{Binding Waypoints}" FontSize="16" Margin="17,110,0,-25"/>
+    </Grid>
+</Page>

+ 45 - 0
Breda-Tour/RouteSelectScreen/RouteExample.xaml.cs

@@ -0,0 +1,45 @@
+using Breda_Tour.Data;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace Breda_Tour.RouteSelectScreen
+{
+    /// <summary>
+    /// An empty page that can be used on its own or navigated to within a Frame.
+    /// </summary>
+    public sealed partial class RouteExample : Page
+    {
+        Route route;
+        public string Waypoints { get; set; } 
+
+        public RouteExample()
+        {
+            this.InitializeComponent();
+        }
+
+        protected override void OnNavigatedTo(NavigationEventArgs e)
+        {
+            route = e.Parameter as Route;
+            Waypoints = "Aantal waypoints: " + 0;
+            this.DataContext = route;
+            //if (route.Waypoints.Count != 0){
+              //  waypoints = route.Waypoints.Count;
+            //}
+        }
+    }
+}

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

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