private void Pin_Clicked(object sender, EventArgs e) { var pin = (Pin)sender; SelectedTempat = tempats.Where(x => x.TempatId.ToString() == pin.AutomationId).FirstOrDefault(); if (SelectedTempat != null) { Status = String.Empty; AbsenCommand.ChangeCanExecute(); } }
private void Current_PositionChanged(object sender, Plugin.Geolocator.Abstractions.PositionEventArgs e) { if (SelectedTempat != null && e.Position.Accuracy > 50) { var m = map.Pins.Where(x => x.AutomationId == SelectedTempat.TempatId.ToString()).FirstOrDefault(); if (m != null) { Distance distance4 = Distance.BetweenPositions(new Position(e.Position.Latitude, e.Position.Longitude), m.Position); SelectedTempat.Distance = distance4; } AbsenCommand.ChangeCanExecute(); } else { Status = "Anda Belum Memilik Tempat"; } }