Prechádzať zdrojové kódy

Merge branch 'RouteSelect' into MultiLanguage

# Conflicts:
#	Breda-Tour/SettingsScreen/SettingsPage.xaml.cs
jancoow 10 rokov pred
rodič
commit
a3cb7e56c2
34 zmenil súbory, kde vykonal 1026 pridanie a 153 odobranie
  1. BIN
      Breda-Tour/Assets/Flag_Icon.png
  2. BIN
      Breda-Tour/Assets/Map.png
  3. BIN
      Breda-Tour/Assets/Map_Icon.png
  4. BIN
      Breda-Tour/Assets/Marker.png
  5. BIN
      Breda-Tour/Assets/UitklapIcon1.png
  6. BIN
      Breda-Tour/Assets/UitklapIcon2.png
  7. 64 0
      Breda-Tour/Breda-Tour.csproj
  8. 1 1
      Breda-Tour/CustomControls/DefaultPivotControl.xaml.cs
  9. 96 0
      Breda-Tour/Data/Gps.cs
  10. 24 0
      Breda-Tour/Data/Picture.cs
  11. 17 4
      Breda-Tour/Data/Route.cs
  12. 9 9
      Breda-Tour/Data/RouteDatabase.cs
  13. 16 16
      Breda-Tour/Data/waypoint.cs
  14. 1 1
      Breda-Tour/HelpScreen/HelpPage.xaml.cs
  15. 32 1
      Breda-Tour/HelpScreen/HelpScreenPage.xaml
  16. 21 1
      Breda-Tour/HelpScreen/HelpScreenPage.xaml.cs
  17. 3 1
      Breda-Tour/MainPage.xaml.cs
  18. 27 0
      Breda-Tour/MapScreen/ImageViewPage.xaml
  19. 49 0
      Breda-Tour/MapScreen/ImageViewPage.xaml.cs
  20. 30 0
      Breda-Tour/MapScreen/MapPage.xaml
  21. 178 0
      Breda-Tour/MapScreen/MapPage.xaml.cs
  22. 53 0
      Breda-Tour/MapScreen/WpDetailPage.xaml
  23. 80 0
      Breda-Tour/MapScreen/WpDetailPage.xaml.cs
  24. 12 29
      Breda-Tour/Package.appxmanifest
  25. 32 0
      Breda-Tour/RouteSelectScreen/BoolToString.cs
  26. 33 0
      Breda-Tour/RouteSelectScreen/Converter.cs
  27. 53 0
      Breda-Tour/RouteSelectScreen/RouteExample.xaml
  28. 118 0
      Breda-Tour/RouteSelectScreen/RouteExample.xaml.cs
  29. 29 1
      Breda-Tour/RouteSelectScreen/RouteSelectPage.xaml
  30. 18 2
      Breda-Tour/RouteSelectScreen/RouteSelectPage.xaml.cs
  31. 7 28
      Breda-Tour/SettingsScreen/SettingsPage.xaml
  32. 6 42
      Breda-Tour/SettingsScreen/SettingsPage.xaml.cs
  33. 16 16
      Breda-Tour/Storage/routes/routes.json
  34. 1 1
      Breda-Tour/project.lock.json

BIN
Breda-Tour/Assets/Flag_Icon.png


BIN
Breda-Tour/Assets/Map.png


BIN
Breda-Tour/Assets/Map_Icon.png


BIN
Breda-Tour/Assets/Marker.png


BIN
Breda-Tour/Assets/UitklapIcon1.png


BIN
Breda-Tour/Assets/UitklapIcon2.png


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

@@ -100,6 +100,37 @@
     </Content>
     <PRIResource Include="en-US\Resources.resw" />
     <None Include="project.json" />
+    <Content Include="Assets\Flag_Icon.png" />
+    <Content Include="Assets\Map.png" />
+    <Content Include="Assets\Map_Icon.png" />
+    <Content Include="Assets\UitklapIcon1.png" />
+    <Content Include="Assets\UitklapIcon2.png" />
+    <Content Include="Storage\Images\1.jpg" />
+    <Content Include="Storage\Images\10.jpg" />
+    <Content Include="Storage\Images\11.jpg" />
+    <Content Include="Storage\Images\12.jpg" />
+    <Content Include="Storage\Images\13.jpg" />
+    <Content Include="Storage\Images\14.jpg" />
+    <Content Include="Storage\Images\15.jpg" />
+    <Content Include="Storage\Images\16.jpg" />
+    <Content Include="Storage\Images\17.jpg" />
+    <Content Include="Storage\Images\18.jpg" />
+    <Content Include="Storage\Images\19.jpg" />
+    <Content Include="Storage\Images\2.jpg" />
+    <Content Include="Storage\Images\20.jpg" />
+    <Content Include="Storage\Images\21.jpg" />
+    <Content Include="Storage\Images\22.jpg" />
+    <Content Include="Storage\Images\23.jpg" />
+    <Content Include="Storage\Images\24.jpg" />
+    <Content Include="Storage\Images\25.jpg" />
+    <Content Include="Storage\Images\26.jpg" />
+    <Content Include="Storage\Images\3.jpg" />
+    <Content Include="Storage\Images\4.jpg" />
+    <Content Include="Storage\Images\5.jpg" />
+    <Content Include="Storage\Images\6.jpg" />
+    <Content Include="Storage\Images\7.jpg" />
+    <Content Include="Storage\Images\8.jpg" />
+    <Content Include="Storage\Images\9.jpg" />
     <Content Include="Storage\helpimages\taal_1.jpg">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
@@ -118,6 +149,7 @@
     <Compile Include="App.xaml.cs">
       <DependentUpon>App.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Data\Picture.cs" />
     <Compile Include="Data\HelpItem.cs" />
     <Compile Include="Data\HelpItemStep.cs" />
     <Compile Include="Data\HelpPageDatabase.cs" />
@@ -130,6 +162,7 @@
     <Compile Include="CustomControls\DefaultTopBar.xaml.cs">
       <DependentUpon>DefaultTopBar.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Data\Gps.cs" />
     <Compile Include="HelpScreen\HelpPage.xaml.cs">
       <DependentUpon>HelpPage.xaml</DependentUpon>
     </Compile>
@@ -139,8 +172,22 @@
     <Compile Include="MainPage.xaml.cs">
       <DependentUpon>MainPage.xaml</DependentUpon>
     </Compile>
+    <Compile Include="MapScreen\ImageViewPage.xaml.cs">
+      <DependentUpon>ImageViewPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="MapScreen\MapPage.xaml.cs">
+      <DependentUpon>MapPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="MapScreen\WpDetailPage.xaml.cs">
+      <DependentUpon>WpDetailPage.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Notification.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="RouteSelectScreen\BoolToString.cs" />
+    <Compile Include="RouteSelectScreen\Converter.cs" />
+    <Compile Include="RouteSelectScreen\RouteExample.xaml.cs">
+      <DependentUpon>RouteExample.xaml</DependentUpon>
+    </Compile>
     <Compile Include="RouteSelectScreen\RouteSelectPage.xaml.cs">
       <DependentUpon>RouteSelectPage.xaml</DependentUpon>
     </Compile>
@@ -159,6 +206,7 @@
   </ItemGroup>
   <ItemGroup>
     <Content Include="Assets\Ags_Logo.png" />
+    <Content Include="Assets\Marker.png" />
     <Content Include="Properties\Default.rd.xml" />
     <Content Include="Assets\LockScreenLogo.scale-200.png" />
     <Content Include="Assets\SplashScreen.scale-200.png" />
@@ -193,6 +241,22 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="RouteSelectScreen\RouteExample.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="MapScreen\ImageViewPage.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="MapScreen\MapPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="MapScreen\WpDetailPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="RouteSelectScreen\RouteSelectPage.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 1 - 1
Breda-Tour/CustomControls/DefaultPivotControl.xaml.cs

@@ -63,7 +63,7 @@ namespace Breda_Tour.CustomControls
 
         private void MapRadioButton_Checked(object sender, RoutedEventArgs e)
         {
-
+            MainPage.RootFrame.Navigate(typeof (MapScreen.MapPage));
         }
 
         private void SettingsRadioButton_Checked(object sender, RoutedEventArgs e)

+ 96 - 0
Breda-Tour/Data/Gps.cs

@@ -0,0 +1,96 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using Windows.Devices.AllJoyn;
+using Windows.Devices.Geolocation;
+using Windows.Devices.Geolocation.Geofencing;
+using Windows.System;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Media.Animation;
+using Breda_Tour.MapScreen;
+
+namespace Breda_Tour.Data
+{
+    public class Gps
+    {
+        private MapPage mapPage;
+        private Geolocator geolocator;
+
+        private Geoposition _position;
+        public Geoposition Position
+        {
+            get { return _position; }
+        }
+
+        public List<BasicGeoposition> History { get; set; }
+
+
+        private PositionStatus _status;
+        public PositionStatus Status
+        {
+            get { return _status; }
+        }
+
+        public Gps(MapPage mapPage)
+        {
+            History = new List<BasicGeoposition>();
+            this.mapPage = mapPage;
+        }
+
+        public async void Start()
+        {
+            var accessStatus = await Geolocator.RequestAccessAsync();
+
+            switch (accessStatus)
+            {
+                case GeolocationAccessStatus.Allowed:
+                    geolocator = new Geolocator { DesiredAccuracyInMeters = 5, MovementThreshold = 2 };
+                    // Subscribe events
+                    geolocator.StatusChanged += OnStatusChanged;
+                    geolocator.PositionChanged += OnPositionChanged;
+                    // Get position
+                    _position = await geolocator.GetGeopositionAsync();
+                    break;
+                case GeolocationAccessStatus.Denied:
+                    _status = PositionStatus.NotAvailable;
+                    geolocator = null;
+                    bool result = await Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-location"));
+                    Refresh();
+                    break;
+                case GeolocationAccessStatus.Unspecified:
+                    _status = PositionStatus.NotAvailable;
+                    break;
+            }
+        }
+
+        private void OnPositionChanged(Geolocator sender, PositionChangedEventArgs args)
+        {
+            _position = args.Position;
+            mapPage.ShowLocaton(_position.Coordinate.Point);
+            //For route history line
+            BasicGeoposition BasicG = _position.Coordinate.Point.Position;
+            History.Add(BasicG);
+            if (History.Count >= 2)
+            {
+                mapPage.DrawWalkingPath(History);
+            }
+        }
+
+        private void OnStatusChanged(Geolocator sender, StatusChangedEventArgs args)
+        {
+            if (args.Status == PositionStatus.Disabled)
+            {
+                _position = null;
+            }
+        }
+
+        public async void Refresh()
+        {
+            if (geolocator != null)
+            {
+                _position = await geolocator.GetGeopositionAsync();
+                mapPage.ShowLocaton(_position.Coordinate.Point);
+            }
+        }
+    }
+}

+ 24 - 0
Breda-Tour/Data/Picture.cs

@@ -0,0 +1,24 @@
+using Windows.UI.ViewManagement;
+
+namespace Breda_Tour.Data
+{
+    public class Picture
+    {
+        private string _source;
+
+        public string Source
+        {
+            get { return _source; }
+        }
+
+        public double Width
+        {
+            get { return ApplicationView.GetForCurrentView().VisibleBounds.Width; }
+        }
+
+        public Picture(string source)
+        {
+            _source = source;
+        }
+    }
+}

+ 17 - 4
Breda-Tour/Data/Route.cs

@@ -3,15 +3,28 @@ using System.Collections.Generic;
 
 namespace Breda_Tour.Data
 {
-    class Route
+    public class Route
     {
-        public String Title {  get; private set; }
-        public List<Waypoint> Waypoints { get; private set; }
+        public String Title { get; private set; }
+        private List<Waypoint> _waypoints;
+        public List<Waypoint> Waypoints
+        {
+            get { return _waypoints; }
+        }
 
         public Route(String Title, List<Waypoint> Waypoints)
         {
             this.Title = Title;
-            this.Waypoints = Waypoints;
+            this._waypoints = Waypoints;
         }
+
+        //public void CreateTestWaypoints()
+        //{
+        //    _waypoints.Add(new Waypoint(51.530805, 4.498676, "Test1", 1, new Image("ms-appx:///Assets/1.jpg"))); { description = "4. Als u de brug overgaat, ziet u aan uw linkerhand het Nassau-Baroniemonument. Bij de ingang van het stadspark, het Valkenberg, staat een monument dat u iets vertelt over de wordings- geschiedenis van de stad Breda, maar vooral over de Heren van de stad uit het Huis van Nassau en de 500-jarige band tussen Breda en het Huis van Nassau. Op 3 juli 1905 werd het Nassau-Baronie- monument, zoals het officieel heet, met  veel feestelijk vertoon door Koningin Wilhelmina onthuld. Het beeld herinnert aan het feit, dat in 1404 Graaf Engelbert, de eerste Bredase Nassau en zijn gemalin, Johanna van Polanen, werden ingehuldigd als Heer en Vrouwe van Breda. De ontwerper is de welbekende dr. P.J.H. Cuypers, die o.m. het Rijksmuseum en het Centraal Station in Amsterdam ontwierp. Op dit monument zijn niet alleen de wapenschilden van twintig gemeenten in en rond de Baronie aangebracht maar ook de Leeuw van Nassau die boven alles uittorent met koningskroon, zwaard en wapenschild. In de drie reliëfs is de 'blijde incomste' van Graaf Engelbert en zijn gemalin afgebeeld. De poortersbieden de sleutel van de stad aan." });
+        //    _waypoints.Add(new Waypoint(51.533461, 4.492711, "Test2", 2, null));
+        //    _waypoints.Add(new Waypoint(51.536998, 4.477862, "Test3", 3, null));
+        //    _waypoints.Add(new Waypoint(51.531285, 4.475394, "Test4", 4, null));
+        //    _waypoints.Add(new Waypoint(51.531566, 4.466747, "Test5", 5, null));
+        //}
     }
 }

+ 9 - 9
Breda-Tour/Data/RouteDatabase.cs

@@ -1,6 +1,7 @@
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.IO;
 using System.Linq;
 using System.Threading.Tasks;
@@ -9,7 +10,7 @@ namespace Breda_Tour.Data
 {
     class RouteDatabase
     {
-        private List<Route> Routes;
+        public List<Route> Routes;
         
         public RouteDatabase()
         {
@@ -19,15 +20,14 @@ namespace Breda_Tour.Data
 
         private void readRoutes()
         {
-            Task.Run(() =>
+
+            string json = File.ReadAllText("Storage/Routes/routes.json");
+            JObject JsonObject = JObject.Parse(json);
+            IList<JToken> JsonList = JsonObject["Routes"].ToList();
+            foreach (JToken route in JsonList)
             {
-                string json = File.ReadAllText("Storage/Routes/routes.json");
-                JObject JsonObject = JObject.Parse(json);
-                IList<JToken> JsonList = JsonObject["Routes"].ToList();
-                foreach (JToken route in JsonList){
-                   Routes.Add(JsonConvert.DeserializeObject<Route>(route.ToString()));
-                }
-        });
+                Routes.Add(JsonConvert.DeserializeObject<Route>(route.ToString()));
+            }
         }
     }
 }

+ 16 - 16
Breda-Tour/Data/waypoint.cs

@@ -7,32 +7,32 @@ using Windows.Devices.Geolocation;
 
 namespace Breda_Tour.Data
 {
-    class Waypoint
+    public class Waypoint
     {
-        public Geopoint Position { get; private set; }
+        private Geopoint _position;
+        public Geopoint Position
+        {
+            get { return _position; }
+        }
+
         public String Title { get; private set; }
         public String Description { get; private set; }
-        public List<Image> Photos { get; private set; }
+        public List<Picture> Pictures { get; private set; }
+        public bool FromPreview { get; set; } 
 
-        public Waypoint(float Lat, float Long, String Title, String Description, List<string> pictures)
+        public Waypoint(double Lat, double Long, String Title, String Description, List<string> pictures)
         {
-            this.Position = new Geopoint(new BasicGeoposition() { Altitude = 0, Latitude = Lat, Longitude = Long });
+            this._position = new Geopoint(new BasicGeoposition() { Altitude = 0, Latitude = Lat, Longitude = Long });
             this.Title = Title;
             this.Description = Description;
-            this.Photos = new List<Image>();
+            this.Pictures = new List<Picture>();
             if (pictures != null)
             {
-                Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+                foreach (var imageSource in pictures)
                 {
-                    foreach (string source in pictures)
-                    {
-                        Photos.Add(new Image
-                        {
-                            Source = new BitmapImage(new Uri("file://Storages/images/" + source)),
-                            Name = source
-                        });
-                    }
-                });
+                    string newSource = "ms-appx:///Storage/Images/" + imageSource;
+                    Pictures.Add(new Picture(newSource));
+                }
             }
         }
     }

+ 1 - 1
Breda-Tour/HelpScreen/HelpPage.xaml.cs

@@ -47,7 +47,7 @@ namespace Breda_Tour.HelpScreen
 
         private void Close_Tapped(object sender, TappedRoutedEventArgs e)
         {
-            MainPage.RootFrame.Navigate(typeof(SettingsPage));
+            MainPage.RootFrame.Navigate(typeof(HelpScreenPage));
         }
 
         private void PageBack_Tapped(object sender, TappedRoutedEventArgs e)

+ 32 - 1
Breda-Tour/HelpScreen/HelpScreenPage.xaml

@@ -6,6 +6,7 @@
     xmlns:c="using:Breda_Tour.CustomControls"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:data="using:Breda_Tour.Data"
     mc:Ignorable="d">
 
     <Grid>
@@ -17,7 +18,37 @@
         <c:DefaultTopBar Header="Help" x:Uid="HelpScreenPagetxtHelpScreen"/>
         <c:DefaultPivotControl x:Name="DefaultPivot" Grid.Row="1"/>
         <StackPanel Grid.Row="2" Background="White">
-            
+            <ScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Hidden">
+                <StackPanel Orientation="Vertical" Background="White">
+                   <TextBlock x:Uid="AppSettingsHelp" Style="{StaticResource SettingsHeaderStyle}" Foreground="{StaticResource BredaToursMainColorBrush}" Text="{StaticResource AppSettingsHelp}"></TextBlock>
+                    <ListView ItemsSource="{x:Bind HelpItems}" IsItemClickEnabled="True" ItemClick="ListView_ItemClick" >
+                        <ListView.ItemTemplate >
+                            <DataTemplate  x:DataType="data:HelpItem">
+                                <ListBoxItem Padding="0" Background="Transparent" IsEnabled="False">
+                                    <Grid Height="50">
+                                        <Grid.ColumnDefinitions>
+                                            <ColumnDefinition Width="50"/>
+                                            <ColumnDefinition Width="*"/>
+                                        </Grid.ColumnDefinitions>
+                                        <Ellipse Height="40" Width="40" Stroke="{StaticResource BredaToursMainColorBrush}" StrokeThickness="0.5"
+                                             Margin="5"
+                                             Name="FolderEllipse"/>
+                                        <SymbolIcon Symbol="Folder"
+                                                Foreground="{StaticResource BredaToursMainColorBrush}"
+                                                Margin="10"
+                                                >
+                                            <SymbolIcon.RenderTransform>
+                                                <RotateTransform Angle="270" CenterX="15" CenterY="15"/>
+                                            </SymbolIcon.RenderTransform>
+                                        </SymbolIcon>
+                                        <TextBlock RelativePanel.RightOf="FolderEllipse" Margin="10,14" Text="{x:Bind Title}" Grid.Column="1"/>
+                                    </Grid>
+                                </ListBoxItem>
+                            </DataTemplate>
+                        </ListView.ItemTemplate>
+                    </ListView>
+                </StackPanel>
+            </ScrollViewer>
         </StackPanel>
     </Grid>
 </Page>

+ 21 - 1
Breda-Tour/HelpScreen/HelpScreenPage.xaml.cs

@@ -1,5 +1,7 @@
-using System;
+using Breda_Tour.Data;
+using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.IO;
 using System.Linq;
 using System.Runtime.InteropServices.WindowsRuntime;
@@ -22,11 +24,29 @@ namespace Breda_Tour.HelpScreen
     /// </summary>
     public sealed partial class HelpScreenPage : Page
     {
+        public ObservableCollection<HelpItem> HelpItems
+        {
+            get { return (ObservableCollection<HelpItem>)GetValue(HelpItemProperty); }
+            set { SetValue(HelpItemProperty, value); }
+        }
+        public static readonly DependencyProperty HelpItemProperty =
+        DependencyProperty.Register("HelpItems", typeof(ObservableCollection<HelpItem>), typeof(HelpScreenPage), null);
+
+
         public HelpScreenPage()
         {
             this.InitializeComponent();
             DefaultPivot.SetCheckedButton(Breda_Tour.CustomControls.DefaultPivotControl.Tab.Help);
+            HelpPageDatabase helpDatabase = new HelpPageDatabase();
+            HelpItems = helpDatabase.GetCurrentHelpItems();
 
+            DataContext = this;
+        }
+
+        private void ListView_ItemClick(object sender, ItemClickEventArgs e)
+        {
+            HelpItem helpitem = (HelpItem)e.ClickedItem;
+            MainPage.RootFrame.Navigate(typeof(HelpPage), helpitem);
         }
     }
 }

+ 3 - 1
Breda-Tour/MainPage.xaml.cs

@@ -14,6 +14,8 @@ using Windows.UI.Xaml.Data;
 using Windows.UI.Xaml.Input;
 using Windows.UI.Xaml.Media;
 using Windows.UI.Xaml.Navigation;
+using Breda_Tour.MapScreen;
+using Breda_Tour.RouteSelectScreen;
 
 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
 
@@ -30,7 +32,7 @@ namespace Breda_Tour
         {
             this.InitializeComponent();
             f = this.rootFrame;
-            f.Navigate(typeof(SettingsPage));
+            f.Navigate(typeof(RouteSelectPage));
         }
 
         public static Frame RootFrame {

+ 27 - 0
Breda-Tour/MapScreen/ImageViewPage.xaml

@@ -0,0 +1,27 @@
+<Page
+    x:Class="Breda_Tour.MapScreen.ImageViewPage"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="using:Breda_Tour.MapScreen"
+    xmlns:c="using:Breda_Tour.CustomControls"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:Maps ="using:Windows.UI.Xaml.Controls.Maps"
+    xmlns:customControls="using:Breda_Tour.CustomControls"
+    mc:Ignorable="d"
+    x:Name="ImageViewer" 
+    >
+
+    <Grid>
+        <ScrollViewer ZoomMode="Enabled"  
+              MinZoomFactor="1" 
+              MaxZoomFactor="4"
+              HorizontalScrollBarVisibility="Hidden"
+              VerticalScrollBarVisibility="Hidden"
+              >
+            <Image Name="Image"  
+            MaxWidth="{Binding DataContext.PageWidth, ElementName=ImageViewer}"
+            MaxHeight="{Binding DataContext.PageHeight, ElementName=ImageViewer}"/>
+        </ScrollViewer>
+    </Grid>
+</Page>

+ 49 - 0
Breda-Tour/MapScreen/ImageViewPage.xaml.cs

@@ -0,0 +1,49 @@
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Core;
+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;
+using Breda_Tour.Data;
+
+namespace Breda_Tour.MapScreen
+{
+    /// <summary>
+    /// An empty page that can be used on its own or navigated to within a Frame.
+    /// </summary>
+    public sealed partial class ImageViewPage : Page
+    {
+        Waypoint previouswaypoint;
+        public ImageViewPage()
+        {
+            this.InitializeComponent();
+        }
+
+        protected override void OnNavigatedTo(NavigationEventArgs e)
+        {
+            Tuple<ImageSource, Waypoint> parameters = (Tuple<ImageSource, Waypoint>)e.Parameter;
+            this.Image.Source = parameters.Item1;
+            previouswaypoint = parameters.Item2;
+            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
+            SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested;
+        }
+
+        private void MainPage_BackRequested(object sender, BackRequestedEventArgs e)
+        {
+            e.Handled = true;
+            SystemNavigationManager.GetForCurrentView().BackRequested -= MainPage_BackRequested;
+            MainPage.RootFrame.Navigate(typeof (WpDetailPage), previouswaypoint);
+        }
+    }
+}

+ 30 - 0
Breda-Tour/MapScreen/MapPage.xaml

@@ -0,0 +1,30 @@
+<Page
+    x:Class="Breda_Tour.MapScreen.MapPage"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="using:Breda_Tour.MapScreen"
+    xmlns:c="using:Breda_Tour.CustomControls"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:Maps ="using:Windows.UI.Xaml.Controls.Maps"
+    xmlns:customControls="using:Breda_Tour.CustomControls"
+    mc:Ignorable="d">
+
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="Auto" />
+            <RowDefinition Height="Auto" />
+            <RowDefinition Height="*" />
+        </Grid.RowDefinitions>
+
+        <c:DefaultTopBar Header="Kaart" Grid.Row="0"/>
+        <c:DefaultPivotControl x:Name="DefaultPivot" Grid.Row="1"/>
+
+        <Maps:MapControl x:Name="Map" Grid.Row="2" MapElementClick="Map_OnMapElementClick"        
+       ZoomInteractionMode="GestureAndControl"
+       TiltInteractionMode="GestureAndControl"
+       RotateInteractionMode="GestureAndControl"
+       MapServiceToken="P4P2fAwXuk7ndsVIsaaV~uYjur55RgwmLsiwFwd72bQ~ApDRixf1L-0o_kMY8EtBBDm8xe7G2oz1k2-u0HQIATvSp-iiKr5KLNkYc1HF5D5e"/>
+   
+    </Grid>
+</Page>

+ 178 - 0
Breda-Tour/MapScreen/MapPage.xaml.cs

@@ -0,0 +1,178 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.CompilerServices;
+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;
+using Windows.Devices.Geolocation;
+using Windows.Services.Maps;
+using Windows.Storage.Streams;
+using Windows.UI;
+using Windows.UI.Core;
+using Windows.UI.Xaml.Automation;
+using Windows.UI.Xaml.Controls.Maps;
+using Windows.UI.Xaml.Shapes;
+using Breda_Tour.CustomControls;
+using System.Diagnostics;
+using Windows.Devices.Geolocation.Geofencing;
+using Windows.UI.Xaml.Automation.Peers;
+using Breda_Tour.Data;
+using Breda_Tour.RouteSelectScreen;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace Breda_Tour.MapScreen
+{
+    /// <summary>
+    /// An empty page that can be used on its own or navigated to within a Frame.
+    /// </summary>
+    public sealed partial class MapPage : Page
+    {
+        private MapIcon marker;
+        private Geopoint point;
+        private Gps gps;
+        private Route route;
+
+        public MapPage()
+        {
+            GeofenceMonitor.Current.GeofenceStateChanged += OnGeofenceStateChange; 
+            this.NavigationCacheMode = NavigationCacheMode.Enabled;
+            marker = new MapIcon();
+            marker.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Marker.png"));
+            marker.NormalizedAnchorPoint = new Point(0.5, 0.5);
+            gps = new Gps(this);
+            gps.Start();
+            this.InitializeComponent();
+        }
+
+        protected override void OnNavigatedTo(NavigationEventArgs e)
+        {
+            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
+            DefaultPivot.SetCheckedButton(DefaultPivotControl.Tab.Map);
+            if (RouteExample.fromRouteExamp)
+            {
+                RouteExample.fromRouteExamp = false;
+                route = e.Parameter as Route;
+                Map.MapElements.Clear();
+                gps.History.Clear();
+                gps.Refresh();
+                ShowWaypoints(route);
+                //ShowRoute();
+            }
+        }
+
+        public async void ShowLocaton(Geopoint point)
+        {
+            this.point = point;
+            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+           {
+               Map.Center = point;
+               if (!Map.MapElements.Contains(marker))
+               {
+                   Map.MapElements.Add(marker);
+               }
+               marker.Location = point;
+           });
+            await Map.TrySetViewAsync(point, 17);
+        }
+
+        public async void ShowRoute()
+        {
+            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+            {
+                Map.Routes.Add(RouteExample.routeView);
+            });
+            //await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
+            //{
+            //    List<Geopoint> geopoints = new List<Geopoint>();
+            //    foreach (Waypoint wayPoint in route.Waypoints)
+            //    {
+            //        geopoints.Add(wayPoint.Position);
+            //    }
+            //    MapRouteFinderResult finder = await MapRouteFinder.GetWalkingRouteFromWaypointsAsync(geopoints);
+            //    if (finder.Status == MapRouteFinderStatus.Success)
+            //    {
+            //        MapRouteView routeView = new MapRouteView(finder.Route);
+            //        routeView.RouteColor = Colors.Firebrick;
+            //        routeView.OutlineColor = Colors.Black;
+            //        Map.Routes.Add(routeView);
+            //    }
+            //});
+        }
+
+        public async void ShowWaypoints(Route route)
+        {
+            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+            {
+                GeofenceMonitor.Current.Geofences.Clear();
+                for (int x = 0; x < route.Waypoints.Count; x++)
+                {
+                    //Waypoints handeling
+                    Waypoint wayp = route.Waypoints.ElementAt(x);
+                    MapIcon wp = new MapIcon { Location = wayp.Position, Title = (x + 1).ToString() };
+                    Map.MapElements.Add(wp);
+                    //Geofencing handeling
+                    string name = $"Fence {(x + 1).ToString()}";
+                    GeofenceMonitor.Current.Geofences.Add(new Geofence(name,new Geocircle(wayp.Position.Position,10), MonitoredGeofenceStates.Entered, true,TimeSpan.FromSeconds(3)));
+                    Debug.Write("Geofences count: "+ GeofenceMonitor.Current.Geofences.Count);
+                }
+                //foreach (var waypoint in route.WayPoints)
+                //{
+                //    MapIcon wp = new MapIcon() {Location = waypoint.Position, Title = waypoint.number.ToString()};
+                //    Map.MapElements.Add(wp);
+                //}
+            });
+        }
+
+        private void Map_OnMapElementClick(MapControl sender, MapElementClickEventArgs args)
+        {
+            MapIcon Icon = args.MapElements.FirstOrDefault(x => x is MapIcon) as MapIcon;
+            for (int x = 0; x < route.Waypoints.Count; x++)
+            {
+                if (Icon.Title != "")
+                {
+                    if (x + 1 == int.Parse(Icon.Title))
+                    {
+                        MainPage.RootFrame.Navigate(typeof(WpDetailPage), route.Waypoints.ElementAt(x));
+                    }
+                }
+            }
+            //foreach (var waypoint in route.WayPoints)
+            //{
+            //    if (Icon.Title != "")
+            //    {
+            //        if (waypoint.number == int.Parse(Icon.Title))
+            //        {
+            //            MainPage.RootFrame.Navigate(typeof(WpDetailPage), waypoint);
+            //        }
+            //    }
+            //}
+        }
+
+        public async void DrawWalkingPath(List<BasicGeoposition> positions)
+        {
+            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+            {
+                MapPolyline mapPolyline = new MapPolyline();
+                mapPolyline.StrokeColor = Colors.Blue;
+                mapPolyline.StrokeThickness = 3;
+                mapPolyline.Path = new Geopath(positions);
+                Map.MapElements.Add(mapPolyline);
+            });
+        }
+
+        private void OnGeofenceStateChange(GeofenceMonitor sender, object args)
+        {
+            Debug.Write("Kappa circle entered!!");
+        }
+    }
+}

+ 53 - 0
Breda-Tour/MapScreen/WpDetailPage.xaml

@@ -0,0 +1,53 @@
+<Page
+    x:Class="Breda_Tour.MapScreen.WpDetailPage"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="using:Breda_Tour.MapScreen"
+    xmlns:c ="using:Breda_Tour.CustomControls"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:data="using:Breda_Tour.Data"
+    mc:Ignorable="d">
+
+    <Grid Background="White">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition Height="*"/>
+        </Grid.RowDefinitions>
+
+        <c:DefaultTopBar x:Name="NameBar" Grid.Row="0" Header="{x:Bind wp.Title}"/>
+        <ListView Grid.Row="1" ItemsSource="{x:Bind wp.Pictures}"
+                  ScrollViewer.HorizontalScrollMode="Enabled"
+                    ScrollViewer.IsHorizontalRailEnabled="True"
+                    ScrollViewer.VerticalScrollMode="Disabled" HorizontalAlignment="Left" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
+            <ListView.ItemsPanel>
+                <ItemsPanelTemplate>
+                    <StackPanel Orientation="Horizontal"/>
+                </ItemsPanelTemplate>
+            </ListView.ItemsPanel>
+            <ListView.ItemContainerStyle>
+                <Style TargetType="ListViewItem">
+                    <Setter Property="Padding" Value="0"/>
+                    <Setter Property="Margin" Value="0"/>
+                </Style>
+            </ListView.ItemContainerStyle>
+            <ListView.ItemTemplate >
+                <DataTemplate x:DataType="data:Picture">
+                    <Image Source="{x:Bind Source}" Height="{x:Bind Width}" Width="{x:Bind Width}" Stretch="UniformToFill" />
+                </DataTemplate>
+            </ListView.ItemTemplate>
+        </ListView>
+
+        <RelativePanel Grid.Row="2">
+            <TextBlock Text="Beschrijving" FontSize="20" Margin="15,15,0,15" />
+            <Line X1="0" X2="{x:Bind Width, Mode=OneTime}" Y1="50" Y2="50" Stroke="Gray" StrokeThickness="2" />
+        </RelativePanel>
+        <RelativePanel Grid.Row="3">
+            <ScrollViewer Margin="15,0,0,0" VerticalScrollBarVisibility="Auto" >
+                <TextBlock HorizontalAlignment="Stretch"  VerticalAlignment="Stretch" TextWrapping="Wrap" Text="{x:Bind wp.Description}"/>
+            </ScrollViewer>
+        </RelativePanel>
+    </Grid>
+</Page>

+ 80 - 0
Breda-Tour/MapScreen/WpDetailPage.xaml.cs

@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Core;
+using Windows.UI.ViewManagement;
+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;
+using Breda_Tour.Data;
+using Breda_Tour.RouteSelectScreen;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace Breda_Tour.MapScreen
+{
+    /// <summary>
+    /// An empty page that can be used on its own or navigated to within a Frame.
+    /// </summary>
+    public sealed partial class WpDetailPage : Page
+    {
+        private Waypoint wp;
+        public double Width { get; }
+
+        public WpDetailPage()
+        {
+            this.InitializeComponent();
+            Width = ApplicationView.GetForCurrentView().VisibleBounds.Width;
+        }
+
+        protected override void OnNavigatedTo(NavigationEventArgs e)
+        {
+            wp = e.Parameter as Waypoint;
+            this.DataContext = wp;
+            if (wp.FromPreview)
+            {
+                SystemNavigationManager.GetForCurrentView().BackRequested += RouteExample_BackRequested;
+            }
+            else
+            {
+                SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested;
+            }
+            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
+            wp.FromPreview = false;
+        }
+
+        private void RouteExample_BackRequested(object sender, BackRequestedEventArgs e)
+        {
+            e.Handled = true;
+            SystemNavigationManager.GetForCurrentView().BackRequested -= RouteExample_BackRequested;
+            MainPage.RootFrame.Navigate(typeof(RouteExample));
+        }
+
+        private void MainPage_BackRequested(object sender, BackRequestedEventArgs e)
+        {
+            e.Handled = true;
+            SystemNavigationManager.GetForCurrentView().BackRequested -= MainPage_BackRequested;
+            MainPage.RootFrame.Navigate(typeof(MapPage));
+        }
+
+        private void Image_PointerPressed(object sender, TappedRoutedEventArgs e)
+        {
+            Image i = (Image)sender;
+            MainPage.RootFrame.Navigate(typeof(ImageViewPage), new Tuple<ImageSource, Waypoint>(i.Source, wp));
+        }
+
+        private void Image_Tapped(object sender, TappedRoutedEventArgs e)
+        {
+
+        }
+    }
+}
+

+ 12 - 29
Breda-Tour/Package.appxmanifest

@@ -1,49 +1,32 @@
 <?xml version="1.0" encoding="utf-8"?>
-
-<Package
-  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
-  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
-  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
-  IgnorableNamespaces="uap mp">
-
-  <Identity
-    Name="322906c3-d44f-4dc7-9bb2-1f0e00fb09e8"
-    Publisher="CN=Paul de Mast"
-    Version="1.0.0.0" />
-
-  <mp:PhoneIdentity PhoneProductId="322906c3-d44f-4dc7-9bb2-1f0e00fb09e8" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
-
+<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
+  <Identity Name="322906c3-d44f-4dc7-9bb2-1f0e00fb09e8" Publisher="CN=Paul de Mast" Version="1.0.0.0" />
+  <mp:PhoneIdentity PhoneProductId="322906c3-d44f-4dc7-9bb2-1f0e00fb09e8" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
   <Properties>
     <DisplayName>Breda-Tour</DisplayName>
     <PublisherDisplayName>Paul de Mast</PublisherDisplayName>
     <Logo>Assets\StoreLogo.png</Logo>
   </Properties>
-
   <Dependencies>
     <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
   </Dependencies>
-
   <Resources>
-    <Resource Language="x-generate"/>
+    <Resource Language="x-generate" />
   </Resources>
-
   <Applications>
-    <Application Id="App"
-      Executable="$targetnametoken$.exe"
-      EntryPoint="Breda_Tour.App">
-      <uap:VisualElements
-        DisplayName="Breda-Tour"
-        Square150x150Logo="Assets\Square150x150Logo.png"
-        Square44x44Logo="Assets\Square44x44Logo.png"
-        Description="Breda-Tour"
-        BackgroundColor="transparent">
-        <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
+    <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Breda_Tour.App">
+      <uap:VisualElements DisplayName="Breda-Tour" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Breda-Tour" BackgroundColor="transparent">
+        <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
+        </uap:DefaultTile>
         <uap:SplashScreen Image="Assets\SplashScreen.png" />
+        <uap:InitialRotationPreference>
+          <uap:Rotation Preference="portrait" />
+        </uap:InitialRotationPreference>
       </uap:VisualElements>
     </Application>
   </Applications>
-
   <Capabilities>
     <Capability Name="internetClient" />
+    <DeviceCapability Name="location" />
   </Capabilities>
 </Package>

+ 32 - 0
Breda-Tour/RouteSelectScreen/BoolToString.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Windows.UI.Xaml.Data;
+
+namespace Breda_Tour.RouteSelectScreen
+{
+    class BoolToString : IValueConverter
+    {
+        private object GetString(object value)
+        {
+            if (!(value is bool))
+                return "ms-appx:///Assets/UitklapIcon1.png";
+            bool objValue = (bool)value;
+            if (objValue)
+            {
+                return "ms-appx:///Assets/UitklapIcon2.png";
+            }
+            return "ms-appx:///Assets/UitklapIcon1.png";
+        }
+        public object Convert(object value, Type targetType, object parameter, string language)
+        {
+            return GetString(value);
+        }
+        public object ConvertBack(object value, Type targetType, object parameter, string language)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 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();
+        }
+    }
+}

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

@@ -0,0 +1,53 @@
+<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>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition Height="*"/>
+        </Grid.RowDefinitions>
+
+        <c:DefaultTopBar Grid.Row="0" Header="Routevoorbeeld"/>
+
+        <StackPanel Grid.Row="1">
+            <StackPanel Orientation="Horizontal" Margin="10,10,0,0">
+                <TextBlock Text="Route informatie" FontSize="16"/>
+                <Button x:Name="StartButton" Visibility="Collapsed" Click="Button_Click" Margin="120,0,0,0" >
+                    <TextBlock Text="Start Route"/>
+                </Button>
+            </StackPanel>
+            <TextBlock x:Name="RouteBlok" FontSize="16" Margin="10,0,0,0"/>
+            <ProgressRing x:Name="ProgressRing" Height="40" Width="40" IsActive="True" HorizontalAlignment="Left" Margin="20,0,0,0" Foreground="Black"/>
+            <TextBlock x:Name="Loopblok" FontSize="16" Margin="10,0,0,0" />
+            <TextBlock x:Name="WaypointsBlok" FontSize="16" Margin="10,0,0,10"/>
+
+        </StackPanel>
+        <StackPanel Grid.Row="2">
+            <Image Source="ms-appx:///Assets/Map.png" Width="360"  />
+        </StackPanel>
+
+        <ListView Grid.Row="3" Margin="10,0,0,0" x:Name="Waypoints" ItemsSource="{x:Bind route.Waypoints}" IsItemClickEnabled="True" ItemClick="Waypoints_OnItemClick">
+            <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">
+                    <TextBlock Text="{x:Bind Title}" />
+                </DataTemplate>
+            </ListView.ItemTemplate>
+        </ListView>
+    </Grid>
+</Page>

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

@@ -0,0 +1,118 @@
+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.Devices.Geolocation;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.Services.Maps;
+using Windows.UI;
+using Windows.UI.Core;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Maps;
+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;
+using Breda_Tour.MapScreen;
+
+// 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 WaypointsText { get; set; }
+        public string RouteTijdText { get; set; }
+        public string LoopafstandText { get; set; }
+        public static bool fromRouteExamp;
+        public static MapRouteView routeView;
+
+        public RouteExample()
+        {
+            MapService.ServiceToken =
+                "P4P2fAwXuk7ndsVIsaaV~uYjur55RgwmLsiwFwd72bQ~ApDRixf1L-0o_kMY8EtBBDm8xe7G2oz1k2-u0HQIATvSp-iiKr5KLNkYc1HF5D5e";
+            InitializeComponent();
+            NavigationCacheMode = NavigationCacheMode.Enabled;
+        }
+
+        protected override void OnNavigatedTo(NavigationEventArgs e)
+        {
+            if (route == null)
+            {
+                route = e.Parameter as Route;
+                ShowRouteInfo();
+            }
+            //Setting the back button functionality
+            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
+            SystemNavigationManager.GetForCurrentView().BackRequested += BackRequested;
+            
+        }
+
+        private void BackRequested(object sender, BackRequestedEventArgs e)
+        {
+            e.Handled = true;
+            SystemNavigationManager.GetForCurrentView().BackRequested -= BackRequested;
+            MainPage.RootFrame.Navigate(typeof(RouteSelectPage));
+        }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            fromRouteExamp = true;
+            MainPage.RootFrame.Navigate(typeof(MapPage), route);
+        }
+
+        private async void ShowRouteInfo()
+        {
+            //Setting the x amount of waypoints text
+            WaypointsText = "Aantal waypoints: " + 0;
+            if (route.Waypoints.Count != 0)
+            {
+                WaypointsText = "Aantal waypoints: " + route.Waypoints.Count;
+            }
+            //Setting the Route distance and time text
+            List<Geopoint> geopoints = new List<Geopoint>();
+            foreach (Waypoint wayPoint in route.Waypoints)
+            {
+                geopoints.Add(wayPoint.Position);
+            }
+            MapRouteFinderResult finder = await MapRouteFinder.GetWalkingRouteFromWaypointsAsync(geopoints);
+            Debug.Write("Finder status: " + finder.Status);
+            if (finder.Status == MapRouteFinderStatus.Success)
+            {
+                //Create route for mapPage
+                routeView = new MapRouteView(finder.Route);
+                routeView.RouteColor = Colors.Firebrick;
+                routeView.OutlineColor = Colors.Black;
+                //route duration
+                int tijd = ((int) finder.Route.EstimatedDuration.TotalMinutes);
+                RouteTijdText = $"Tijdsduur: {tijd} min";
+                RouteBlok.Text = RouteTijdText;
+                //Route distance
+                LoopafstandText = $"Loopafstand: {(Convert.ToInt32(finder.Route.LengthInMeters/1000))} km";
+                Loopblok.Text = LoopafstandText;
+                //Waypoint text
+                WaypointsBlok.Text = WaypointsText;
+                ProgressRing.Visibility = Visibility.Collapsed;
+                StartButton.Visibility = Visibility.Visible;
+            }
+            StartButton.Visibility = Visibility.Visible;
+        }
+
+        private void Waypoints_OnItemClick(object sender, ItemClickEventArgs e)
+        {
+            Waypoint wp = e.ClickedItem as Waypoint;
+            wp.FromPreview = true;
+            MainPage.RootFrame.Navigate(typeof(WpDetailPage),wp);
+        }
+    }
+}

+ 29 - 1
Breda-Tour/RouteSelectScreen/RouteSelectPage.xaml

@@ -6,8 +6,11 @@
     xmlns:c="using:Breda_Tour.CustomControls"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:data="using:Breda_Tour.Data"
+    xmlns:con="using:Breda_Tour.RouteSelectScreen"
     mc:Ignorable="d">
 
+
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="40"/>
@@ -16,6 +19,31 @@
         </Grid.RowDefinitions>
         <c:DefaultTopBar x:Uid="RouteSelectPagetxtSelectRoute" Header="Route Selecteren"/>
         <c:DefaultPivotControl x:Name="DefaultPivot" Grid.Row="1"/>
-        
+        <RelativePanel Grid.Row="2" Margin="0,5">
+            <RelativePanel.Resources>
+                <con:Converter x:Key="BoolToVis"/>
+                <con:BoolToString x:Key="BoolToString"/>
+            </RelativePanel.Resources>
+            <ListView x:Name="Routes" ItemsSource="{x:Bind AllRoutes.Routes}" IsItemClickEnabled="True" ItemClick="Routes_ItemClick">
+                <ListView.ItemTemplate>
+                    <DataTemplate x:DataType="data:Route">
+                        <StackPanel>
+                            <StackPanel Orientation="Horizontal" Width="340">
+                                <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" Background="Transparent" IsChecked="False" Width="40" Height="40" Margin="35,0,0,0">
+                                    <Image Source="{Binding Path=IsChecked, ElementName=toggleButton,Converter={StaticResource BoolToString}}" Height="29" Margin="-10,0,-9,-1"/>
+                                </ToggleButton>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal" Width="340" Visibility="{Binding Path=IsChecked, ElementName=toggleButton,Converter={StaticResource BoolToVis}}">
+                                <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>
+        </RelativePanel>
     </Grid>
 </Page>

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

@@ -1,10 +1,12 @@
-using System;
+using Breda_Tour.Data;
+using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using System.Runtime.InteropServices.WindowsRuntime;
 using Windows.Foundation;
 using Windows.Foundation.Collections;
+using Windows.UI.Core;
 using Windows.UI.Xaml;
 using Windows.UI.Xaml.Controls;
 using Windows.UI.Xaml.Controls.Primitives;
@@ -22,10 +24,24 @@ namespace Breda_Tour.RouteSelectScreen
     /// </summary>
     public sealed partial class RouteSelectPage : Page
     {
+        RouteDatabase AllRoutes;
+
         public RouteSelectPage()
         {
+            AllRoutes = new RouteDatabase();
             this.InitializeComponent();
             DefaultPivot.SetCheckedButton(CustomControls.DefaultPivotControl.Tab.RouteSelected);
         }
+
+        protected override void OnNavigatedTo(NavigationEventArgs e)
+        {
+            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
+        }
+
+        private void Routes_ItemClick(object sender, ItemClickEventArgs e)
+        {
+            Route route = e.ClickedItem as Route;
+            MainPage.RootFrame.Navigate(typeof (RouteExample), route);
+        }
     }
-}
+}

+ 7 - 28
Breda-Tour/SettingsScreen/SettingsPage.xaml

@@ -25,34 +25,13 @@
                         <TextBlock x:Uid="AppSettingstxtLanguageString" Margin="0,-1,0,0" FontSize="12"  Text="Nederlands"></TextBlock>
                     </StackPanel>
                 </ListViewItem>
-                <Rectangle Margin="0,15,0,0" Fill="#99000000" Height="1" />
-                <TextBlock x:Uid="AppSettingsHelp" Style="{StaticResource SettingsHeaderStyle}" Foreground="{StaticResource BredaToursMainColorBrush}" Text="{StaticResource AppSettingsHelp}"></TextBlock>
-                <ListView ItemsSource="{x:Bind HelpItems}" IsItemClickEnabled="True" ItemClick="ListView_ItemClick" >
-                    <ListView.ItemTemplate >
-                        <DataTemplate  x:DataType="data:HelpItem">
-                            <ListBoxItem Padding="0" Background="Transparent" IsEnabled="False">
-                                    <Grid Height="50">
-                                        <Grid.ColumnDefinitions>
-                                            <ColumnDefinition Width="50"/>
-                                            <ColumnDefinition Width="*"/>
-                                        </Grid.ColumnDefinitions>
-                                        <Ellipse Height="40" Width="40" Stroke="{StaticResource BredaToursMainColorBrush}" StrokeThickness="0.5"
-                                             Margin="5"
-                                             Name="FolderEllipse"/>
-                                    <SymbolIcon Symbol="Folder"
-                                                Foreground="{StaticResource BredaToursMainColorBrush}"
-                                                Margin="10"
-                                                >
-                                        <SymbolIcon.RenderTransform>
-                                            <RotateTransform Angle="270" CenterX="15" CenterY="15"/>
-                                        </SymbolIcon.RenderTransform>
-                                    </SymbolIcon>
-                                    <TextBlock RelativePanel.RightOf="FolderEllipse" Margin="10,14" Text="{x:Bind Title}" Grid.Column="1"/>
-                                </Grid>                                
-                            </ListBoxItem>
-                        </DataTemplate>
-                    </ListView.ItemTemplate>
-                </ListView>
+                <Rectangle Margin="0,15,0,15" Fill="#99000000" Height="1" />
+                <ListViewItem Name="listViewItemReset" Tapped="listViewItemReset_Tapped">
+                    <StackPanel Margin="8,0,0,0">
+                        <TextBlock x:Uid="AppSettingstxtReset" FontSize="18" Text="Applicatie resetten" Foreground="#ec0000" ></TextBlock>
+                        <TextBlock x:Uid="AppSettingstxtReset" Margin="0,-1,0,0" FontSize="12"  Text="Route afsluiten en applicatie naar basis instellingen resetten" Foreground="#ec0000"></TextBlock>
+                    </StackPanel>
+                </ListViewItem>
             </StackPanel>
         </ScrollViewer>
     </Grid>

+ 6 - 42
Breda-Tour/SettingsScreen/SettingsPage.xaml.cs

@@ -1,60 +1,20 @@
 using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
 using Breda_Tour;
-
-using Breda_Tour.HelpScreen;
-using Breda_Tour.Data;
-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;
-using Windows.Globalization;
 using System.Threading.Tasks;
-
-// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+using Breda_Tour.SplashScreen;
 
 namespace Breda_Tours.SettingsScreen
 {
-    /// <summary>
-    /// An empty page that can be used on its own or navigated to within a Frame.
-    /// </summary>
     public sealed partial class SettingsPage : Page
     {
-        public ObservableCollection<HelpItem> HelpItems
-        {
-            get { return (ObservableCollection<HelpItem>)GetValue(HelpItemProperty); }
-            set { SetValue(HelpItemProperty, value); }
-        }
-
-        public static readonly DependencyProperty HelpItemProperty =
-        DependencyProperty.Register("HelpItems", typeof(ObservableCollection<HelpItem>), typeof(SettingsPage), null);
-
-        public SettingsPage()
+       public SettingsPage()
         {
             this.InitializeComponent();
 
             DefaultPivot.SetCheckedButton(Breda_Tour.CustomControls.DefaultPivotControl.Tab.Settings);
-            HelpPageDatabase helpDatabase = new HelpPageDatabase();
-            HelpItems = helpDatabase.GetCurrentHelpItems();
-            
-            DataContext = this;
         }
-
-        private void ListView_ItemClick(object sender, ItemClickEventArgs e)
-        {
-            HelpItem helpitem = (HelpItem)e.ClickedItem;
-            MainPage.RootFrame.Navigate(typeof(HelpPage), helpitem);
-		}
 		
         private async void listViewItemSetupLanguage_Tapped(object sender, TappedRoutedEventArgs e)
         {
@@ -71,5 +31,9 @@ namespace Breda_Tours.SettingsScreen
                 MainPage.RootFrame.Navigate(typeof(SettingsPage));
             }
         }
+        private void listViewItemReset_Tapped(object sender, TappedRoutedEventArgs e)
+        {
+            Frame.Navigate(typeof(SplashPage));
+        }
     }
 }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 16 - 16
Breda-Tour/Storage/routes/routes.json


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

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

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov