public NavigatePageViewModel(IUiService uiService) : base(uiService) { DisplayName = "Navigate to ..."; CurrentLocation = new Waypoint() { CreatedDate = DateTime.Now, Description = "bla bla", Id = -4, Position = new GPSPosition() { Latitude = 41, Longitude = 42 } }; }
private async Task WaypointSelected(Waypoint selectedWaypoint) { MessageDialog messageDialog = new MessageDialog("Do you want to navigate to selected location?"); messageDialog.Commands.Add(new UICommand("Navigate", async s => { //TODO: Navigate to a given location //selectedWaypoint })); messageDialog.Commands.Add(new UICommand("Cancel", async s => { })); await messageDialog.ShowAsync(); }
public void Navigate() { Waypoint parameter = new Waypoint() { CreatedDate = DateTime.Now, Description = "bla bla", Id = -4, Position = new GPSPosition() { Latitude = 41.1, Longitude = 42.1 } }; UiService.Navigation.NavigateToViewModel<NavigatePageViewModel>(parameter); }
public IEnumerable<IResult> Save() { var waypoint = new Waypoint { Title = this.Title, CreatedDate = DateTime.Now, Description = this.Description, Position = new GPSPosition { Latitude = this.Latitude, Longitude = this.Longitude, }, }; var waypoints = new Waypoints (); waypoints.Add(waypoint); yield return new SaveResult(waypoints); GoBack(); }