Ejemplo n.º 1
0
        private async void ButtonUndo_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
        {
            didUndo = true;

            try
            {
                await AccountStorage.Instance.UndoRemoveAsync();

                removedAccountBlock.Show(inEditMode);
                accountBlocks.Insert(removedIndex, removedAccountBlock);

                CheckEntries();
                CloseUndo.Begin();
            }
            catch (StaleException)
            {
                RevertAndReload();

                MainPage.AddBanner(new Banner(BannerType.Danger, ResourceLoader.GetForCurrentView().GetString("ChangesDetectedRedoUndo"), true));
            }
            catch (NetworkException)
            {
                RevertAndReload();

                MainPage.AddBanner(new Banner(BannerType.Danger, ResourceLoader.GetForCurrentView().GetString("NoInternetChangesRolledBack"), true));
            }
            catch (Exception ex)
            {
                mainPage.Navigate(typeof(ErrorPage), ex);
            }

            didUndo = false;
        }
Ejemplo n.º 2
0
        private void UndoTimer_Tick(object sender, object e)
        {
            CloseUndo.Begin();

            undoTimer.Stop();
        }