/// <summary> /// This is the constructor for ServiceVisitPage /// </summary> /// <param name="selectedVisit">The service visit is currently showing</param> public ServiceVisitPage(ServiceVisitViewModel selectedVisit) { InitializeComponent(); BindingContext = viewModel = new ServiceVisitPageViewModel(); viewModel.ServiceVisit = selectedVisit; // initialise maps var center = new Position(selectedVisit.PositionLat, selectedVisit.PostionLong); Maps.MoveToRegion( MapSpan.FromCenterAndRadius( center, Distance.FromMiles(1))); var pin = new Pin { Type = PinType.Place, Position = center, Label = "Address", Address = selectedVisit.FullAddress }; pin.Clicked += Pin_Clicked; Maps.Pins.Add(pin); // subscribe message MessagingCenter.Subscribe <ServiceVisitPageViewModel>(this, "updateFailedNotify", async(sender) => { await DisplayAlert("Alert", "Update failed, please try again later.", "OK"); }); }
public ServiceVisitDetailsPage(ServiceVisitViewModel visit) { InitializeComponent(); }