Przeglądaj źródła

Merge branch 'MapView' into RouteSelect

# Conflicts:
#	Breda-Tour/Breda-Tour.csproj
#	Breda-Tour/Data/RouteDatabase.cs
#	Breda-Tour/Data/waypoint.cs

Mapview doesnt create a routedatabase anymore on startup.
jancoow 10 lat temu
rodzic
commit
b79201cb79

BIN
Breda-Tour/Assets/Marker.png


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

@@ -97,6 +97,32 @@
     <Content Include="Assets\Flag_Icon.png" />
     <Content Include="Assets\Map_Icon.png" />
     <Content Include="Assets\UitklapIcon1.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\Routes\routes.json">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
@@ -105,6 +131,7 @@
     <Compile Include="App.xaml.cs">
       <DependentUpon>App.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Data\Picture.cs" />
     <Compile Include="Data\Route.cs" />
     <Compile Include="Data\RouteDatabase.cs" />
     <Compile Include="Data\Waypoint.cs" />
@@ -114,6 +141,7 @@
     <Compile Include="CustomControls\DefaultTopBar.xaml.cs">
       <DependentUpon>DefaultTopBar.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Data\Gps.cs" />
     <Compile Include="HelpScreen\HelpItem.cs" />
     <Compile Include="HelpScreen\HelpPage.xaml.cs">
       <DependentUpon>HelpPage.xaml</DependentUpon>
@@ -121,6 +149,15 @@
     <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="Properties\AssemblyInfo.cs" />
     <Compile Include="RouteSelectScreen\Converter.cs" />
     <Compile Include="RouteSelectScreen\RouteExample.xaml.cs">
@@ -144,6 +181,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" />
@@ -175,6 +213,18 @@
       <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>

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

@@ -59,7 +59,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)

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

@@ -0,0 +1,88 @@
+using System;
+using System.Collections.Generic;
+using Windows.Devices.AllJoyn;
+using Windows.Devices.Geolocation;
+using Windows.System;
+using Windows.UI.Xaml;
+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; }
+        }
+        private List<Geoposition> _history;
+        public List<Geoposition> History
+        {
+            get { return _history; }
+        }
+
+        private PositionStatus _status;
+        public PositionStatus Status
+        {
+            get { return _status; }
+        }
+
+        public Gps(MapPage mapPage)
+        {
+            _history = new List<Geoposition>();
+            this.mapPage = mapPage;
+        }
+
+        public async void Start()
+        {
+            var accessStatus = await Geolocator.RequestAccessAsync();
+
+            switch (accessStatus)
+            {
+                case GeolocationAccessStatus.Allowed:
+                    geolocator = new Geolocator { DesiredAccuracyInMeters = 1, MovementThreshold = 2 };
+                    // Subscribe events
+                    geolocator.StatusChanged += OnStatusChanged;
+                    geolocator.PositionChanged += OnPositionChanged;
+                    // Get position
+                    _position = await geolocator.GetGeopositionAsync();
+                    break;
+                case GeolocationAccessStatus.Denied:
+                    _status = PositionStatus.NotAvailable;
+                    bool result = await Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-location"));
+                    break;
+                case GeolocationAccessStatus.Unspecified:
+                    _status = PositionStatus.NotAvailable;
+                    break;
+            }
+        }
+
+        private void OnPositionChanged(Geolocator sender, PositionChangedEventArgs args)
+        {
+            mapPage.ShowLocaton(args.Position.Coordinate.Point);
+            _position = args.Position;
+        }
+
+        private void OnStatusChanged(Geolocator sender, StatusChangedEventArgs args)
+        {
+            if (args.Status == PositionStatus.Disabled)
+            {
+                _position = null;
+            }
+        }
+
+        public async void Refresh()
+        {
+            if (geolocator == null)
+            {
+                Start();
+            }
+            else
+            {
+                _position = await geolocator.GetGeopositionAsync();
+            }
+        }
+    }
+}

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

+ 1 - 0
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;

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

@@ -7,32 +7,31 @@ 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 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));
+                }
             }
         }
     }

+ 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>

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

@@ -0,0 +1,140 @@
+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 Breda_Tour.Data;
+
+// 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()
+        {
+            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);
+            //route = e.Parameter as Route;
+        }
+
+        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);
+            ShowWaypoints(route);
+            ShowRoute(route);
+        }
+
+        public async void ShowRoute(Route route)
+        {
+            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, () =>
+            {
+                for (int x = 0; x < route.Waypoints.Count; x++)
+                {
+                    Waypoint wayp = route.Waypoints.ElementAt(x);
+                    MapIcon wp = new MapIcon { Location = wayp.Position, Title = (x + 1).ToString() };
+                    Map.MapElements.Add(wp);
+                }
+                //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);
+            //        }
+            //    }
+            //}
+        }
+    }
+}

+ 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>

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

@@ -0,0 +1,65 @@
+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;
+
+// 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;
+
+            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(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>

+ 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",