private void LoadDownloadButton() { var notation = NotationStorageHelper.Get(_notationId); if (notation != null) { _downloadToolbarItem.IconImageSource = ImageSource.FromFile("icon_downloaded.png"); } else { _downloadToolbarItem.IconImageSource = ImageSource.FromFile("icon_download.png"); } }
public async void DownloadNotation() { var notation = NotationStorageHelper.Get(_notationId); if (notation != null) { NotationStorageHelper.Remove(_notationId); _downloadToolbarItem.IconImageSource = ImageSource.FromFile("icon_download.png"); await Application.Current.MainPage.DisplayAlert("Success", "Notation has been deleted from the device.", "OK"); } else { await NotationStorageHelper.Add(_notation); _downloadToolbarItem.IconImageSource = ImageSource.FromFile("icon_downloaded.png"); await Application.Current.MainPage.DisplayAlert("Success", "Notation successfully saved.", "OK"); } }
private async Task LoadNotation() { if (HasConnectivity) { Notation = await _serviceNotations.GetById <Model.Notations>(_notationId); } else { Notation = NotationStorageHelper.Get(_notationId); if (Notation == null) { await Application.Current.MainPage.DisplayAlert("Error", "Could not load notation.", "OK"); #pragma warning disable CS0612 // Type or member is obsolete Application.Current.MainPage = new MainPage(); #pragma warning restore CS0612 // Type or member is obsolete return; } } LastEditInfo = "on " + Notation.LastEditted.ToShortDateString(); Title = Notation.Type.ToString() + "s"; }