Ejemplo n.º 1
0
        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");
            }
        }
Ejemplo n.º 2
0
        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");
            }
        }
Ejemplo n.º 3
0
        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";
        }