So many changes...
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
<ResourceDictionary x:Key="Dark" Source="Themes/DarkTheme.xaml"/>
|
||||
<ResourceDictionary x:Key="Light" Source="Themes/LightTheme.xaml"/>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Themes/DefaultStyles.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
||||
|
||||
@@ -96,13 +96,12 @@ namespace NavCityBreda
|
||||
|
||||
rootFrame.NavigationFailed += OnNavigationFailed;
|
||||
|
||||
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
|
||||
if (e.PreviousExecutionState != ApplicationExecutionState.Running)
|
||||
{
|
||||
//TODO: Load state from previously suspended application
|
||||
InitPage extendedSplash = new InitPage(e.SplashScreen);
|
||||
rootFrame.Content = extendedSplash;
|
||||
Window.Current.Content = rootFrame;
|
||||
}
|
||||
|
||||
// Place the frame in the current Window
|
||||
Window.Current.Content = rootFrame;
|
||||
}
|
||||
|
||||
if (rootFrame.Content == null)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
namespace NavCityBreda.Helpers
|
||||
{
|
||||
class BoolToCheckmarkConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
if ((bool)value)
|
||||
return Symbol.Like;
|
||||
else
|
||||
return Symbol.Cancel;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
//Not implemented
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
namespace NavCityBreda.Helpers
|
||||
{
|
||||
class BoolToVisitedConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
if ((bool)value)
|
||||
return "Visited";
|
||||
else
|
||||
return "Not visited";
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
//Not implemented
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,8 @@ namespace NavCityBreda.Helpers
|
||||
static Settings()
|
||||
{
|
||||
//Define default settings here
|
||||
if (LOCAL_SETTINGS.Values["track"] == null)
|
||||
LOCAL_SETTINGS.Values["track"] = true;
|
||||
}
|
||||
|
||||
public static async void ChangeLanguage(string lang)
|
||||
|
||||
@@ -5,8 +5,11 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.ApplicationModel.Resources;
|
||||
using Windows.Devices.Geolocation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Graphics.Display;
|
||||
using Windows.Services.Maps;
|
||||
using Windows.UI;
|
||||
using Windows.UI.ViewManagement;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Maps;
|
||||
@@ -38,6 +41,17 @@ namespace NavCityBreda.Helpers
|
||||
}
|
||||
}
|
||||
|
||||
public static Size ScreenSize
|
||||
{
|
||||
get
|
||||
{
|
||||
var bounds = ApplicationView.GetForCurrentView().VisibleBounds;
|
||||
var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
|
||||
Size size = new Size(bounds.Width * scaleFactor, bounds.Height * scaleFactor);
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
public static MainPage MainPage
|
||||
{
|
||||
get {
|
||||
@@ -61,6 +75,13 @@ namespace NavCityBreda.Helpers
|
||||
return b;
|
||||
}
|
||||
|
||||
public static async Task<MapRoute> FindWalkingRoute(List<Geopoint> points)
|
||||
{
|
||||
MapRouteFinderResult routeResult = await MapRouteFinder.GetWalkingRouteFromWaypointsAsync(points);
|
||||
MapRoute b = routeResult.Route;
|
||||
return b;
|
||||
}
|
||||
|
||||
public static async Task<MapRoute> FindWalkingRoute(string from, string to, Geopoint reference)
|
||||
{
|
||||
MapLocation f = await FindLocation(from, reference);
|
||||
@@ -76,6 +97,13 @@ namespace NavCityBreda.Helpers
|
||||
return b;
|
||||
}
|
||||
|
||||
public static async Task<MapRoute> FindDrivingRoute(List<Geopoint> points)
|
||||
{
|
||||
MapRouteFinderResult routeResult = await MapRouteFinder.GetDrivingRouteFromWaypointsAsync(points);
|
||||
MapRoute b = routeResult.Route;
|
||||
return b;
|
||||
}
|
||||
|
||||
public static async Task<MapRoute> FindDrivingRoute(string from, string to, Geopoint reference)
|
||||
{
|
||||
MapLocation f = await FindLocation(from, reference);
|
||||
@@ -124,7 +152,8 @@ namespace NavCityBreda.Helpers
|
||||
ZIndex = 2
|
||||
};
|
||||
|
||||
line.Path = new Geopath(m.Path.Positions);
|
||||
if (m != null)
|
||||
line.Path = new Geopath(m.Path.Positions);
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<Page
|
||||
x:Class="NavCityBreda.InitPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:NavCityBreda"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Background="White">
|
||||
<Canvas>
|
||||
<Image x:Name="extendedSplashImage" Source="Assets/SplashScreen.png" VerticalAlignment="Center"/>
|
||||
</Canvas>
|
||||
|
||||
<RelativePanel Name="splashProgress" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<StackPanel RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignHorizontalCenterWithPanel="True" Margin="0,0,0,20">
|
||||
<ProgressRing IsActive="True" Width="25" Margin="0,0,0,10" Foreground="#F2E5F2" />
|
||||
<TextBlock Name="splashProgressText" Text="..." FontSize="13" Foreground="#B8A5C5"/>
|
||||
</StackPanel>
|
||||
</RelativePanel>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.Graphics.Display;
|
||||
using Windows.UI.Core;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
namespace NavCityBreda
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class InitPage : Page
|
||||
{
|
||||
internal Rect splashImageRect; // Rect to store splash screen image coordinates.
|
||||
private SplashScreen splash; // Variable to hold the splash screen object.
|
||||
internal bool dismissed = false; // Variable to track splash screen dismissal status.
|
||||
internal Frame rootFrame;
|
||||
|
||||
public InitPage(SplashScreen splashscreen)
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
// Listen for window resize events to reposition the extended splash screen image accordingly.
|
||||
// This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
|
||||
Window.Current.SizeChanged += ExtendedSplash_OnResize;
|
||||
|
||||
splash = splashscreen;
|
||||
|
||||
if (splash != null)
|
||||
{
|
||||
// Register an event handler to be executed when the splash screen has been dismissed.
|
||||
splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);
|
||||
|
||||
// Retrieve the window coordinates of the splash screen image.
|
||||
splashImageRect = splash.ImageLocation;
|
||||
PositionImage();
|
||||
}
|
||||
|
||||
// Create a Frame to act as the navigation context
|
||||
rootFrame = new Frame();
|
||||
}
|
||||
|
||||
// Position the extended splash screen image in the same location as the system splash screen image.
|
||||
void PositionImage()
|
||||
{
|
||||
var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
|
||||
extendedSplashImage.SetValue(Canvas.LeftProperty, splashImageRect.X);
|
||||
extendedSplashImage.SetValue(Canvas.TopProperty, splashImageRect.Y - 21);
|
||||
extendedSplashImage.Height = splashImageRect.Height / scaleFactor;
|
||||
extendedSplashImage.Width = splashImageRect.Width / scaleFactor;
|
||||
}
|
||||
|
||||
void ExtendedSplash_OnResize(Object sender, WindowSizeChangedEventArgs e)
|
||||
{
|
||||
// Safely update the extended splash screen image coordinates. This function will be fired in response to snapping, unsnapping, rotation, etc...
|
||||
if (splash != null)
|
||||
{
|
||||
// Update the coordinates of the splash screen image.
|
||||
splashImageRect = splash.ImageLocation;
|
||||
PositionImage();
|
||||
}
|
||||
}
|
||||
|
||||
// Include code to be executed when the system has transitioned from the splash screen to the extended splash screen (application's first view).
|
||||
void DismissedEventHandler(SplashScreen sender, object e)
|
||||
{
|
||||
dismissed = true;
|
||||
AwaitInitialize();
|
||||
}
|
||||
|
||||
private async void AwaitInitialize()
|
||||
{
|
||||
while (App.RouteManager.LoadingElement != "Done")
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(500));
|
||||
Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
|
||||
{
|
||||
splashProgressText.Text = App.RouteManager.LoadingElement;
|
||||
});
|
||||
}
|
||||
|
||||
while (App.Geo.Connected == null)
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(250));
|
||||
Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
|
||||
{
|
||||
splashProgressText.Text = "Waiting on GPS...";
|
||||
});
|
||||
}
|
||||
|
||||
Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
|
||||
{
|
||||
// Navigate to mainpage
|
||||
rootFrame.Navigate(typeof(MainPage));
|
||||
App.rootFrame = rootFrame;
|
||||
// Place the frame in the current Window
|
||||
Window.Current.Content = rootFrame;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,8 +62,14 @@
|
||||
ManipulationMode="TranslateX"
|
||||
ManipulationCompleted="MySplitviewPane_ManipulationCompleted"
|
||||
Background="Transparent">
|
||||
|
||||
|
||||
<ListBox RelativePanel.AlignTopWithPanel="True" SelectionMode="Single" Name="NavList" SelectionChanged="NavList_SelectionChanged" Tapped="NavList_Tapped">
|
||||
<ListBoxItem Name="NavListMap">
|
||||
<StackPanel Style="{StaticResource NavStackPanel}">
|
||||
<TextBlock Style="{StaticResource NavIcon}" Text=""/>
|
||||
<TextBlock Style="{StaticResource NavText}" x:Uid="MenuItemMap" Text="[MenuItemMap]"/>
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Name="NavListRoute">
|
||||
<StackPanel Style="{StaticResource NavStackPanel}">
|
||||
<TextBlock Style="{StaticResource NavIcon}" Text=""/>
|
||||
|
||||
@@ -78,21 +78,22 @@ namespace NavCityBreda
|
||||
break;
|
||||
case "helpview":
|
||||
PageTitle.Text = Util.Loader.GetString("PageTitleHelp");
|
||||
NavListHelp.IsSelected = true;
|
||||
NavList.SelectedIndex = 2;
|
||||
break;
|
||||
case "settingsview":
|
||||
PageTitle.Text = Util.Loader.GetString("PageTitleSettings");
|
||||
NavListSettings.IsSelected = true;
|
||||
NavList.SelectedIndex = 3;
|
||||
break;
|
||||
case "mapview":
|
||||
PageTitle.Text = Util.Loader.GetString("PageTitleMap");
|
||||
NavList.SelectedIndex = 0;
|
||||
break;
|
||||
case "routedetailview":
|
||||
PageTitle.Text = Util.Loader.GetString("PageTitleRouteDetail");
|
||||
break;
|
||||
case "routeview":
|
||||
PageTitle.Text = Util.Loader.GetString("PageTitleRoute");
|
||||
NavListRoute.IsSelected = true;
|
||||
NavList.SelectedIndex = 1;
|
||||
break;
|
||||
case "landmarkview":
|
||||
PageTitle.Text = Util.Loader.GetString("PageTitleWaypoint");
|
||||
@@ -109,12 +110,26 @@ namespace NavCityBreda
|
||||
{
|
||||
NavView.IsPaneOpen = false;
|
||||
|
||||
if (NavListHelp.IsSelected)
|
||||
if (NavListMap.IsSelected)
|
||||
{
|
||||
if (Frame != null)
|
||||
{
|
||||
if (Frame.CanGoBack)
|
||||
Frame.BackStack.Clear();
|
||||
Frame.Navigate(typeof(MapView));
|
||||
}
|
||||
}
|
||||
else if (NavListHelp.IsSelected)
|
||||
Frame.Navigate(typeof(HelpView));
|
||||
else if (NavListSettings.IsSelected)
|
||||
Frame.Navigate(typeof(SettingsView));
|
||||
else if(NavListRoute.IsSelected)
|
||||
Frame.Navigate(typeof(RouteView));
|
||||
else if (NavListRoute.IsSelected)
|
||||
{
|
||||
if (App.RouteManager.CurrentRoute == null)
|
||||
Frame.Navigate(typeof(RouteView));
|
||||
else
|
||||
Frame.Navigate(typeof(RouteDetailView), App.RouteManager.CurrentRoute);
|
||||
}
|
||||
}
|
||||
|
||||
private void NavList_Tapped(object sender, TappedRoutedEventArgs e)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace NavCityBreda.Model
|
||||
private Geoposition pos;
|
||||
public Geoposition Position { get { return pos; } }
|
||||
|
||||
public bool Connected { get; private set; }
|
||||
public bool? Connected { get; private set; }
|
||||
|
||||
public GeoTracker()
|
||||
{
|
||||
@@ -30,13 +30,13 @@ namespace NavCityBreda.Model
|
||||
|
||||
public event TypedEventHandler<Geolocator, StatusChangedEventArgs> StatusChanged
|
||||
{
|
||||
add { if(Connected)geo.StatusChanged += value; }
|
||||
add { if(Connected == true) geo.StatusChanged += value; }
|
||||
remove { geo.StatusChanged -= value; }
|
||||
}
|
||||
|
||||
public event TypedEventHandler<Geolocator, PositionChangedEventArgs> PositionChanged
|
||||
{
|
||||
add { if (Connected) geo.PositionChanged += value; }
|
||||
add { if (Connected == true) geo.PositionChanged += value; }
|
||||
remove { geo.PositionChanged -= value; }
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace NavCityBreda.Model
|
||||
geo = new Geolocator {
|
||||
DesiredAccuracy = PositionAccuracy.High,
|
||||
//MovementThreshold = 1
|
||||
ReportInterval = 500
|
||||
ReportInterval = 5000
|
||||
};
|
||||
|
||||
Connected = true;
|
||||
@@ -69,12 +69,14 @@ namespace NavCityBreda.Model
|
||||
break;
|
||||
|
||||
case GeolocationAccessStatus.Denied:
|
||||
Connected = false;
|
||||
status = "Access Denied";
|
||||
bool result = await Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-location"));
|
||||
break;
|
||||
|
||||
default:
|
||||
case GeolocationAccessStatus.Unspecified:
|
||||
Connected = false;
|
||||
status = "Unspecified Error Occured";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Devices.Geolocation;
|
||||
using Windows.Services.Maps;
|
||||
using Windows.UI.Xaml.Controls.Maps;
|
||||
|
||||
namespace NavCityBreda.Model
|
||||
{
|
||||
public class Route
|
||||
{
|
||||
private GeoboundingBox _bounds;
|
||||
public GeoboundingBox Bounds { get { if (_bounds == null) CalculateBounds(); return _bounds; } }
|
||||
public GeoboundingBox Bounds { get { return _route.BoundingBox; } }
|
||||
|
||||
public string Name { get; private set; }
|
||||
public string Description { get; private set; }
|
||||
@@ -23,6 +23,9 @@ namespace NavCityBreda.Model
|
||||
private List<Waypoint> _waypoints;
|
||||
public List<Waypoint> Waypoints { get { return _waypoints; } }
|
||||
|
||||
private MapRoute _route;
|
||||
public MapRoute RouteObject { get { return _route; } }
|
||||
|
||||
public Route(string name, string desc, string landmarks, int minutes)
|
||||
{
|
||||
Name = name;
|
||||
@@ -57,9 +60,10 @@ namespace NavCityBreda.Model
|
||||
_waypoints.Remove(w);
|
||||
}
|
||||
|
||||
private void CalculateBounds()
|
||||
public async Task<String> CalculateRoute()
|
||||
{
|
||||
_bounds = BoundingBox.GetBoundingBox(_waypoints.Select(p => p.Location).ToList());
|
||||
_route = await Util.FindWalkingRoute(_waypoints.Select(p => p.Location).ToList());
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,16 +16,16 @@ namespace NavCityBreda.Model
|
||||
private Route _currentroute;
|
||||
public Route CurrentRoute { get { return _currentroute; } }
|
||||
|
||||
public string LoadingElement;
|
||||
|
||||
public RouteManager()
|
||||
{
|
||||
_routes = new List<Route>();
|
||||
LoadingElement = "Initializing...";
|
||||
LoadRoutes();
|
||||
|
||||
if (_routes.Count > 0)
|
||||
_currentroute = _routes.First();
|
||||
}
|
||||
|
||||
private void LoadRoutes()
|
||||
private async void LoadRoutes()
|
||||
{
|
||||
string[] routefiles = Directory.GetFiles(Util.RouteWaypointsFolder);
|
||||
|
||||
@@ -33,8 +33,14 @@ namespace NavCityBreda.Model
|
||||
|
||||
foreach(string file in routefiles)
|
||||
{
|
||||
_routes.Add(JSONParser.LoadRoute(file));
|
||||
Route r = JSONParser.LoadRoute(file);
|
||||
LoadingElement = "Loading " + r.Name + "...";
|
||||
await r.CalculateRoute();
|
||||
_routes.Add(r);
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(250));
|
||||
}
|
||||
|
||||
LoadingElement = "Done";
|
||||
}
|
||||
|
||||
public void SetCurrentRoute(int index)
|
||||
|
||||
@@ -90,9 +90,21 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
|
||||
<Content Include="Assets\SplashScreen.scale-100.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Assets\SplashScreen.scale-150.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Waypoints\historische_kilometer.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Waypoints\test_route_1.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Waypoints\test_route_2.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<PRIResource Include="Strings\ja-JP\Resources.resw" />
|
||||
<PRIResource Include="Strings\de-DE\Resources.resw" />
|
||||
<PRIResource Include="Strings\nl-NL\Resources.resw" />
|
||||
@@ -103,11 +115,16 @@
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helpers\BoolToCheckmarkConverter.cs" />
|
||||
<Compile Include="Helpers\BoolToVisitedConverter.cs" />
|
||||
<Compile Include="Helpers\BoudingBox.cs" />
|
||||
<Compile Include="Helpers\Extensions.cs" />
|
||||
<Compile Include="Helpers\JSONParser.cs" />
|
||||
<Compile Include="Helpers\Settings.cs" />
|
||||
<Compile Include="Helpers\Util.cs" />
|
||||
<Compile Include="InitPage.xaml.cs">
|
||||
<DependentUpon>InitPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -119,6 +136,7 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ViewModel\MapVM.cs" />
|
||||
<Compile Include="ViewModel\MenuVM.cs" />
|
||||
<Compile Include="ViewModel\RouteDetailVM.cs" />
|
||||
<Compile Include="ViewModel\RouteVM.cs" />
|
||||
<Compile Include="Views\HelpView.xaml.cs">
|
||||
<DependentUpon>HelpView.xaml</DependentUpon>
|
||||
@@ -146,48 +164,122 @@
|
||||
<None Include="NavCityBreda_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\Square150x150Logo.scale-100.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-100.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Properties\Default.rd.xml" />
|
||||
<Content Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="Assets\StoreLogo.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
<Content Include="Routes\Images\default.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_1.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_10.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_11.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_12.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_13.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_14.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_15.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_16.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_17.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_18.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_19.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_2.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_20.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_21.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_22.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_23.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_24.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_25.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_26.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_3.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_4.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_5.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_6.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_7.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_8.jpg" />
|
||||
<Content Include="Routes\Images\historische_kilometer_9.jpg" />
|
||||
<Content Include="Assets\LockScreenLogo.scale-200.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Assets\SplashScreen.scale-200.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Assets\Square150x150Logo.scale-200.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Assets\Square44x44Logo.scale-200.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Assets\StoreLogo.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Assets\Wide310x150Logo.scale-200.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\default.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_1.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_10.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_11.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_12.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_13.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_14.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_15.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_16.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_17.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_18.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_19.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_2.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_20.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_21.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_22.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_23.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_24.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_25.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_26.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_3.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_4.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_5.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_6.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_7.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_8.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Routes\Images\historische_kilometer_9.jpg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="InitPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -197,6 +289,11 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Themes\DefaultStyles.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Themes\LightTheme.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<uap:VisualElements DisplayName="NavCityBreda" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="NavCityBreda" BackgroundColor="transparent">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" ShortName="ags_logo">
|
||||
</uap:DefaultTile>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="white" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "Test route 1",
|
||||
"description": "Dit is een route om van alles mee te testen!\nHopelijk staat dit op een nieuwe regel.\n\rAnders dit.\r\nAnders dit 2.<br>Misschien dit.",
|
||||
"landmarks": "Een stad, een bos en een meertje. Dit moet eigenlijk vrij kort zijn.",
|
||||
"minutes": 15,
|
||||
"waypoints": [
|
||||
{
|
||||
"name": "Test locatie 1",
|
||||
"landmark": true,
|
||||
"description": "Test locatie 1",
|
||||
"latitude": 51.594112,
|
||||
"longitude": 4.779417
|
||||
},
|
||||
|
||||
{
|
||||
"name": "Test locatie 2",
|
||||
"landmark": true,
|
||||
"description": "Test locatie 2",
|
||||
"latitude": 51.593278,
|
||||
"longitude": 4.779388
|
||||
},
|
||||
{
|
||||
"name": "Test locatie 3",
|
||||
"landmark": false,
|
||||
"latitude": 51.5925,
|
||||
"longitude": 4.779695
|
||||
},
|
||||
{
|
||||
"name": "Test locatie 4",
|
||||
"landmark": false,
|
||||
"latitude": 51.5925,
|
||||
"longitude": 4.779388
|
||||
},
|
||||
{
|
||||
"name": "Test locatie 5",
|
||||
"landmark": true,
|
||||
"description": "Test locatie 5",
|
||||
"latitude": 51.592833,
|
||||
"longitude": 4.778472
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "Test route 2",
|
||||
"description": "Dit is een route om van alles mee te testen!\nHopelijk staat dit op een nieuwe regel.\n\rAnders dit.\r\nAnders dit 2.<br>Misschien dit.",
|
||||
"landmarks": "Een stad, een bos en een meertje. Dit moet eigenlijk vrij kort zijn.",
|
||||
"minutes": 400,
|
||||
"waypoints": [
|
||||
{
|
||||
"name": "Test locatie 6",
|
||||
"landmark": true,
|
||||
"description": "Test locatie 1",
|
||||
"latitude": 51.594112,
|
||||
"longitude": 4.779417
|
||||
},
|
||||
|
||||
{
|
||||
"name": "Test locatie 7",
|
||||
"landmark": true,
|
||||
"description": "Test locatie 2",
|
||||
"latitude": 51.593278,
|
||||
"longitude": 4.779388
|
||||
},
|
||||
{
|
||||
"name": "Test locatie 8",
|
||||
"landmark": false,
|
||||
"latitude": 51.5925,
|
||||
"longitude": 4.779695
|
||||
},
|
||||
{
|
||||
"name": "Test locatie 9",
|
||||
"landmark": false,
|
||||
"latitude": 51.5925,
|
||||
"longitude": 4.779388
|
||||
},
|
||||
{
|
||||
"name": "Test locatie 10",
|
||||
"landmark": true,
|
||||
"description": "Test locatie 5",
|
||||
"latitude": 51.592833,
|
||||
"longitude": 4.778472
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:NavCityBreda.Themes">
|
||||
|
||||
<Style TargetType="SymbolIcon" x:Key="InfoIcon">
|
||||
<Setter Property="Foreground" Value="Gray" />
|
||||
</Style>
|
||||
<Style TargetType="TextBlock" x:Key="InfoText">
|
||||
<Setter Property="Foreground" Value="Gray" />
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<Setter Property="Margin" Value="5,0,0,0" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="TextBlock" x:Key="Header">
|
||||
<Setter Property="FontSize" Value="20" />
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
<Setter Property="Margin" Value="0,0,0,3" />
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -57,7 +57,7 @@ namespace NavCityBreda.ViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
if (App.Geo.Connected && App.Geo.Position != null)
|
||||
if (App.Geo.Connected == true && App.Geo.Position != null)
|
||||
return App.Geo.Position.Coordinate.PositionSource.ToString();
|
||||
else
|
||||
return "N/A";
|
||||
@@ -69,7 +69,7 @@ namespace NavCityBreda.ViewModel
|
||||
get
|
||||
{
|
||||
|
||||
if (App.Geo.Connected && App.Geo.Position != null)
|
||||
if (App.Geo.Connected == true && App.Geo.Position != null)
|
||||
return App.Geo.Position.Coordinate.Accuracy.ToString() + "m";
|
||||
else
|
||||
return "0m";
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
using NavCityBreda.Helpers;
|
||||
using NavCityBreda.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.ViewManagement;
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace NavCityBreda.ViewModel
|
||||
{
|
||||
public class RouteDetailVM
|
||||
{
|
||||
Route route;
|
||||
|
||||
public RouteDetailVM(Route r)
|
||||
{
|
||||
this.route = r;
|
||||
}
|
||||
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return route.Description;
|
||||
}
|
||||
}
|
||||
|
||||
public string Time
|
||||
{
|
||||
get
|
||||
{
|
||||
int hours = route.Minutes / 60;
|
||||
int minutes = route.Minutes % 60;
|
||||
|
||||
return hours + "h " + minutes + "m";
|
||||
}
|
||||
}
|
||||
|
||||
public string Distance
|
||||
{
|
||||
get
|
||||
{
|
||||
double length = route.RouteObject.LengthInMeters;
|
||||
length /= 1000;
|
||||
length = Math.Round(length, 2);
|
||||
return length + "km";
|
||||
}
|
||||
}
|
||||
|
||||
public GridLength ScreenWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return new GridLength(ApplicationView.GetForCurrentView().VisibleBounds.Width);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Landmark> Landmarks
|
||||
{
|
||||
get
|
||||
{
|
||||
return route.Waypoints.Where(p => p is Landmark).Cast<Landmark>().ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,28 +3,47 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:NavCityBreda.Views"
|
||||
xmlns:convert="using:NavCityBreda.Helpers"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Page.Resources>
|
||||
<convert:BoolToCheckmarkConverter x:Key="BoolConverter"/>
|
||||
<convert:BoolToVisitedConverter x:Key="VisitedConverter"/>
|
||||
</Page.Resources>
|
||||
|
||||
<ScrollViewer>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="{Binding Image}" Grid.Row="0" />
|
||||
<StackPanel Grid.Row="1" Margin="10">
|
||||
<TextBlock Text="[WaypointDescription]" x:Uid="WaypointDescription" FontWeight="Bold" Margin="0,0,0,3"/>
|
||||
|
||||
<Grid Grid.Row="1" Margin="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="Street" Style="{StaticResource InfoIcon}"/>
|
||||
<ProgressRing IsActive="True" Name="StreetLoading" Foreground="Gray" Margin="10,0,0,0"/>
|
||||
<TextBlock Name="StreetAddress" Text="" Style="{StaticResource InfoText}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding Visited, Converter={StaticResource BoolConverter}}" Style="{StaticResource InfoIcon}"/>
|
||||
<TextBlock Text="{Binding Visited, Converter={StaticResource VisitedConverter}}" Style="{StaticResource InfoText}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="2" Margin="10">
|
||||
<TextBlock Text="[WaypointDescription]" x:Uid="WaypointDescription" Style="{StaticResource Header}"/>
|
||||
<TextBlock TextWrapping="WrapWholeWords" Text="{Binding Description}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="2" Margin="10">
|
||||
<SymbolIcon Symbol="Street" Foreground="Gray"/>
|
||||
<ProgressRing IsActive="True" Name="StreetLoading" Foreground="Gray" Margin="10,0,0,0"/>
|
||||
<TextBlock Name="StreetAddress" Text="Searching..." Foreground="Gray" Margin="10,0,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<map:MapControl Grid.Row="0" Name="Map" MapElementClick="Map_MapElementClick" ZoomInteractionMode="GestureAndControl" PanInteractionMode="Auto" TiltInteractionMode="ControlOnly" RotateInteractionMode="GestureAndControl" MapServiceToken="74Y70e71HVjjN7lnx4Eh~3wugTlBDe2DbPGuR_AM2aA~AjMbg-pU2qn4gYf97oH0GZI1oY9Jc4vH-4WyIRyoYQM0Q71CnfbWalEN37bdSgms" />
|
||||
|
||||
<map:MapControl Grid.Row="0" Name="Map" MapElementClick="Map_MapElementClick" ZoomInteractionMode="GestureAndControl" PedestrianFeaturesVisible="True" PanInteractionMode="Auto" TiltInteractionMode="ControlOnly" RotateInteractionMode="GestureAndControl" MapServiceToken="74Y70e71HVjjN7lnx4Eh~3wugTlBDe2DbPGuR_AM2aA~AjMbg-pU2qn4gYf97oH0GZI1oY9Jc4vH-4WyIRyoYQM0Q71CnfbWalEN37bdSgms" />
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@@ -19,6 +19,8 @@ using Windows.Storage.Streams;
|
||||
using Windows.UI.Popups;
|
||||
using System.Diagnostics;
|
||||
using NavCityBreda.Helpers;
|
||||
using Windows.UI;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
@@ -29,7 +31,7 @@ namespace NavCityBreda.Views
|
||||
/// </summary>
|
||||
public sealed partial class MapView : Page
|
||||
{
|
||||
MapIcon CurrenPosition;
|
||||
MapIcon CurrentPosition;
|
||||
|
||||
public MapView()
|
||||
{
|
||||
@@ -38,19 +40,27 @@ namespace NavCityBreda.Views
|
||||
|
||||
this.DataContext = new MapVM();
|
||||
|
||||
CurrenPosition = new MapIcon();
|
||||
Map.MapElements.Add(CurrenPosition);
|
||||
CurrentPosition = new MapIcon();
|
||||
CurrentPosition.NormalizedAnchorPoint = new Point(0.5, 1.0);
|
||||
CurrentPosition.Title = "Current Position";
|
||||
CurrentPosition.ZIndex = 999;
|
||||
Map.MapElements.Add(CurrentPosition);
|
||||
|
||||
App.Geo.PositionChanged += Geo_PositionChanged;
|
||||
|
||||
DrawLandmarks();
|
||||
}
|
||||
|
||||
private void DrawLandmarks()
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
if (App.RouteManager.CurrentRoute != null)
|
||||
DrawRoute();
|
||||
}
|
||||
|
||||
private void DrawRoute()
|
||||
{
|
||||
Route r = App.RouteManager.CurrentRoute;
|
||||
|
||||
Map.MapElements.Clear();
|
||||
Map.MapElements.Add(CurrentPosition);
|
||||
|
||||
foreach(Landmark l in r.Waypoints.Where(l => l is Landmark))
|
||||
{
|
||||
@@ -59,9 +69,12 @@ namespace NavCityBreda.Views
|
||||
m.NormalizedAnchorPoint = new Point(0.5, 1.0);
|
||||
m.Title = l.Name;
|
||||
m.ZIndex = 10;
|
||||
//m.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///" + l.Image));
|
||||
Map.MapElements.Add(m);
|
||||
}
|
||||
|
||||
Map.MapElements.Add(Util.GetRouteLine(App.RouteManager.CurrentRoute.RouteObject, Color.FromArgb(255, 100, 100, 255)));
|
||||
|
||||
ZoomRoute();
|
||||
}
|
||||
|
||||
private void Geo_PositionChanged(Geolocator sender, PositionChangedEventArgs args)
|
||||
@@ -74,10 +87,25 @@ namespace NavCityBreda.Views
|
||||
|
||||
private void DrawCurrenPosition(Geopoint p)
|
||||
{
|
||||
CurrenPosition.Location = p;
|
||||
CurrenPosition.NormalizedAnchorPoint = new Point(0.5, 1.0);
|
||||
CurrenPosition.Title = "Current Position";
|
||||
CurrenPosition.ZIndex = 999;
|
||||
if (!Map.MapElements.Contains(CurrentPosition))
|
||||
Map.MapElements.Add(CurrentPosition);
|
||||
|
||||
CurrentPosition.Location = p;
|
||||
if ((bool)Settings.LOCAL_SETTINGS.Values["track"]) ;
|
||||
Zoom();
|
||||
}
|
||||
|
||||
private async void Zoom()
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||
await Map.TrySetViewAsync(CurrentPosition.Location);
|
||||
Map.ZoomLevel = 14;
|
||||
}
|
||||
|
||||
private async void ZoomRoute()
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||
await Map.TrySetViewBoundsAsync(App.RouteManager.CurrentRoute.Bounds, null, Windows.UI.Xaml.Controls.Maps.MapAnimationKind.Linear);
|
||||
}
|
||||
|
||||
private void Map_MapElementClick(MapControl sender, MapElementClickEventArgs args)
|
||||
@@ -91,8 +119,6 @@ namespace NavCityBreda.Views
|
||||
Landmark l = w as Landmark;
|
||||
|
||||
Util.MainPage.Navigate(typeof(LandmarkView), l);
|
||||
|
||||
//Map.TrySetViewBoundsAsync(App.RouteManager.Routes.First().Bounds, new Thickness(10), MapAnimationKind.Bow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,68 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:NavCityBreda.Views"
|
||||
xmlns:model="using:NavCityBreda.Model"
|
||||
xmlns:convert="using:NavCityBreda.Helpers"
|
||||
xmlns:map="using:Windows.UI.Xaml.Controls.Maps"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Page.Resources>
|
||||
<convert:BoolToCheckmarkConverter x:Key="BoolConverter"/>
|
||||
</Page.Resources>
|
||||
|
||||
<ScrollViewer>
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="{Binding ScreenWidth}" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<map:MapControl Grid.Row="0" Name="Map" ZoomInteractionMode="Disabled" RotateInteractionMode="Disabled" TiltInteractionMode="Disabled" PanInteractionMode="Disabled" MapServiceToken="74Y70e71HVjjN7lnx4Eh~3wugTlBDe2DbPGuR_AM2aA~AjMbg-pU2qn4gYf97oH0GZI1oY9Jc4vH-4WyIRyoYQM0Q71CnfbWalEN37bdSgms"/>
|
||||
|
||||
<Grid Grid.Row="1" Margin="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="Clock" Style="{StaticResource InfoIcon}"/>
|
||||
<TextBlock Text="{Binding Time}" Style="{StaticResource InfoText}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="SetTile" Style="{StaticResource InfoIcon}"/>
|
||||
<TextBlock Text="{Binding Distance}" Style="{StaticResource InfoText}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="2" Margin="10">
|
||||
<Button Name="StartRouteButton" Click="StartRouteButton_Click" Content="Start Route" Background="DarkGreen" Foreground="White" HorizontalAlignment="Stretch" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="3" Margin="10">
|
||||
<TextBlock Text="[WaypointDescription]" x:Uid="WaypointDescription" Style="{StaticResource Header}"/>
|
||||
<TextBlock TextWrapping="WrapWholeWords" Text="{Binding Description}"/>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<StackPanel Grid.Row="4" Name="LandmarkListPanel" Margin="10">
|
||||
<TextBlock Text="[LandmarksHeader]" x:Uid="LandmarksListHeader" Style="{StaticResource Header}"/>
|
||||
<ListView x:Name="LandmarkList" ItemsSource="{Binding Landmarks}" IsItemClickEnabled="True" ItemClick="LandmarkList_ItemClick">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:Name="ListViewDataTemplate">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding Visited, Converter={StaticResource BoolConverter}}" Margin="0,0,10,0"/>
|
||||
<TextBlock Text="{Binding Name}" FontSize="18"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
using NavCityBreda.Model;
|
||||
using NavCityBreda.Helpers;
|
||||
using NavCityBreda.Model;
|
||||
using NavCityBreda.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Devices.Geolocation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.UI;
|
||||
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;
|
||||
@@ -28,12 +35,55 @@ namespace NavCityBreda.Views
|
||||
public RouteDetailView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.NavigationCacheMode = NavigationCacheMode.Enabled;
|
||||
}
|
||||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
route = e.Parameter as Route;
|
||||
this.DataContext = route;
|
||||
Route r = e.Parameter as Route;
|
||||
if (r == route)
|
||||
{
|
||||
LandmarkList.SelectedIndex = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
route = r;
|
||||
|
||||
this.DataContext = new RouteDetailVM(route);
|
||||
Util.MainPage.Title = route.Name;
|
||||
|
||||
Zoom();
|
||||
|
||||
MapPolyline m = Util.GetRouteLine(route.RouteObject, Color.FromArgb(255, 100, 100, 255));
|
||||
Map.MapElements.Add(m);
|
||||
|
||||
foreach (Landmark l in route.Waypoints.Where(l => l is Landmark))
|
||||
{
|
||||
MapIcon mi = new MapIcon();
|
||||
mi.Location = l.Location;
|
||||
mi.NormalizedAnchorPoint = new Point(0.5, 1.0);
|
||||
mi.Title = "";
|
||||
mi.ZIndex = 10;
|
||||
Map.MapElements.Add(mi);
|
||||
}
|
||||
}
|
||||
|
||||
private async void Zoom()
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||
await Map.TrySetViewBoundsAsync(route.Bounds, null, Windows.UI.Xaml.Controls.Maps.MapAnimationKind.None);
|
||||
}
|
||||
|
||||
private void LandmarkList_ItemClick(object sender, ItemClickEventArgs e)
|
||||
{
|
||||
MainPage mp = Util.MainPage;
|
||||
mp.Navigate(typeof(LandmarkView), e.ClickedItem as Landmark);
|
||||
}
|
||||
|
||||
private void StartRouteButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
App.RouteManager.SetCurrentRoute(route);
|
||||
Util.MainPage.Navigate(typeof(MapView));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,15 +7,13 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<RelativePanel Grid.Row="2" Margin="0,10,0,0" Name="RouteListPanel">
|
||||
<ListView x:Name="RouteList" ItemsSource="{Binding}" IsItemClickEnabled="True" ItemClick="RouteList_ItemClick" SelectionMode="Extended" RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignTopWithPanel="True" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True">
|
||||
<RelativePanel Grid.Row="2" Name="RouteListPanel">
|
||||
<ListView x:Name="RouteList" ItemsSource="{Binding}" Margin="0,10,0,0" IsItemClickEnabled="True" ItemClick="RouteList_ItemClick" RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignTopWithPanel="True" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:Name="ListViewDataTemplate">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Vertical" Width="140" Margin="10,0,0,0" >
|
||||
<TextBlock Text="{Binding Name}" FontSize="24" />
|
||||
<TextBlock Text="{Binding Landmarks}" FontSize="14" />
|
||||
</StackPanel>
|
||||
<StackPanel Margin="5,0,0,0" Grid.Column="0">
|
||||
<TextBlock Text="{Binding Name}" FontSize="20" TextWrapping="NoWrap"/>
|
||||
<TextBlock Text="{Binding Landmarks}" FontSize="14" TextWrapping="WrapWholeWords" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace NavCityBreda.Views
|
||||
public SettingsView()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
throw new NotImplementedException("Tracking");
|
||||
}
|
||||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user