private async void SaveAlarmAsync() { if (!string.IsNullOrEmpty(Name) && Distance > 0) { try { var location = (await Geocoding.GetLocationsAsync(Name)).FirstOrDefault(); if (location != null) { var newLocationAlarm = new AlarmLocation(Name, Distance, location.Latitude, location.Longitude, true); await mainPageFeatures.AddAlarmAsync(newLocationAlarm); UserDialogs.Instance.Toast("Zapisano alarm.", TimeSpan.FromSeconds(3.0)); Debug.WriteLine(newLocationAlarm.ToString()); } else { UserDialogs.Instance.Toast("Nie można zapisać alarmu. Sprawdź miejsce docelowe.", TimeSpan.FromSeconds(3.0)); } } catch (FeatureNotSupportedException fnsEx) { Debug.WriteLine(fnsEx.Message); } catch (Exception ex) { Debug.WriteLine(ex.Message); } } else { UserDialogs.Instance.Toast("Nie można zapisać alarmu.", TimeSpan.FromSeconds(3.0)); } }