Small improvements
This commit is contained in:
@@ -26,6 +26,7 @@ namespace NavCityBreda.Helpers
|
||||
Route r = new Route((string)o["name"], (string)o["description"], (string)o["landmarks"], Int32.Parse((string)o["minutes"]));
|
||||
|
||||
JToken[] waypoints = o["waypoints"].ToArray();
|
||||
int count = 0;
|
||||
foreach(JToken t in waypoints)
|
||||
{
|
||||
if(!ValidateWaypointObject(t, out error))
|
||||
@@ -34,11 +35,12 @@ namespace NavCityBreda.Helpers
|
||||
Waypoint w;
|
||||
|
||||
if ((bool)t["landmark"])
|
||||
w = new Landmark((double)t["latitude"], (double)t["longitude"], (string)t["name"], (string)o["description"], t["image"].NullOrEmpty() ? "" : (string)t["image"]);
|
||||
w = new Landmark((double)t["latitude"], (double)t["longitude"], (string)t["name"], (string)t["description"], count, t["image"].NullOrEmpty() ? "" : (string)t["image"]);
|
||||
else
|
||||
w = new Waypoint((double)t["latitude"], (double)t["longitude"], (string)t["name"]);
|
||||
w = new Waypoint((double)t["latitude"], (double)t["longitude"], (string)t["name"], count);
|
||||
|
||||
r.Add(w);
|
||||
count++;
|
||||
}
|
||||
|
||||
return r;
|
||||
|
||||
@@ -99,8 +99,12 @@
|
||||
<TextBlock Style="{StaticResource GPSInfoIcon}" Text=""/>
|
||||
<TextBlock Style="{StaticResource GPSInfoText}" Text="{Binding Accuracy}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="15,5">
|
||||
<TextBlock Text="Nav City Breda @"/>
|
||||
<TextBlock Text="{Binding Year}" Margin="5,0,0,0" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="Nav City Breda @ 2015" Margin="15, 5"/>
|
||||
</StackPanel>
|
||||
</RelativePanel>
|
||||
</SplitView.Pane>
|
||||
|
||||
@@ -47,6 +47,18 @@ namespace NavCityBreda
|
||||
}
|
||||
}
|
||||
|
||||
public void Navigate(Type type)
|
||||
{
|
||||
Frame.Navigate(type);
|
||||
}
|
||||
|
||||
public void Navigate(Type type, object param)
|
||||
{
|
||||
Frame.Navigate(type, param);
|
||||
}
|
||||
|
||||
public string Title { get { return PageTitle.Text; } set { PageTitle.Text = value; } }
|
||||
|
||||
public void NavButton_Click(object sender, RoutedEventArgs arg)
|
||||
{
|
||||
NavView.IsPaneOpen = !NavView.IsPaneOpen;
|
||||
@@ -60,8 +72,10 @@ namespace NavCityBreda
|
||||
NavList.SelectedIndex = -1;
|
||||
|
||||
switch (pagename.ToLower())
|
||||
{
|
||||
{
|
||||
default:
|
||||
PageTitle.Text = "Nav City Breda";
|
||||
break;
|
||||
case "helpview":
|
||||
PageTitle.Text = Util.Loader.GetString("PageTitleHelp");
|
||||
NavListHelp.IsSelected = true;
|
||||
@@ -80,7 +94,7 @@ namespace NavCityBreda
|
||||
PageTitle.Text = Util.Loader.GetString("PageTitleRoute");
|
||||
NavListRoute.IsSelected = true;
|
||||
break;
|
||||
case "waypointview":
|
||||
case "landmarkview":
|
||||
PageTitle.Text = Util.Loader.GetString("PageTitleWaypoint");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,8 @@ namespace NavCityBreda.Model
|
||||
|
||||
public async void ForceRefresh()
|
||||
{
|
||||
pos = await geo.GetGeopositionAsync();
|
||||
if(geo != null)
|
||||
pos = await geo.GetGeopositionAsync();
|
||||
}
|
||||
|
||||
private async void StartTracking()
|
||||
|
||||
@@ -16,22 +16,22 @@ namespace NavCityBreda.Model
|
||||
public bool Visited { get; set; }
|
||||
|
||||
|
||||
public Landmark(Geopoint p, string name, string desc, string image_loc = "default.jpg") : base (p, name)
|
||||
public Landmark(Geopoint p, string name, string desc, int num, string image_loc = "default.jpg") : base (p, name, num)
|
||||
{
|
||||
Visited = false;
|
||||
Description = desc;
|
||||
if (image_loc == "" || !File.Exists(Util.RouteImagesFolder + image_loc))
|
||||
image_loc = "default.jpg";
|
||||
Image = Util.RouteImagesFolder + image_loc;
|
||||
Image = "/" + Util.RouteImagesFolder + image_loc;
|
||||
}
|
||||
|
||||
public Landmark(double la, double lo, string name, string desc, string image_loc = "default.jpg") : base(la, lo, name)
|
||||
public Landmark(double la, double lo, string name, string desc, int num, string image_loc = "default.jpg") : base(la, lo, name, num)
|
||||
{
|
||||
Visited = false;
|
||||
Description = desc;
|
||||
if (image_loc == "" || !File.Exists(Util.RouteImagesFolder + image_loc))
|
||||
image_loc = "default.jpg";
|
||||
Image = Util.RouteImagesFolder + image_loc;
|
||||
Image = "/" + Util.RouteImagesFolder + image_loc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,5 +75,14 @@ namespace NavCityBreda.ViewModel
|
||||
return "0m";
|
||||
}
|
||||
}
|
||||
|
||||
public string Year
|
||||
{
|
||||
get
|
||||
{
|
||||
int year = DateTime.Now.Year;
|
||||
return year.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user