private void toggleUndoDeletion(bool show) { if (snackBar != null) { snackBar.Hide(); snackBar = null; } if (!show) { return; } snackBar = SnackBar.Factory.CreateUndoSnackBar( onUndo: () => ViewModel.TimeEntriesViewModel.CancelDeleteTimeEntry.Execute(Unit.Default)); snackBar.SnackBottomAnchor = StartTimeEntryButton.TopAnchor; snackBar.Show(superView: View); }
private void toggleUndoDeletion(int?numberOfTimeEntriesPendingDeletion) { if (snackBar != null) { snackBar.Hide(); snackBar = null; } if (!numberOfTimeEntriesPendingDeletion.HasValue) { return; } var undoText = numberOfTimeEntriesPendingDeletion > 1 ? String.Format(Resources.MultipleEntriesDeleted, numberOfTimeEntriesPendingDeletion) : Resources.EntryDeleted; snackBar = SnackBar.Factory.CreateUndoSnackBar( onUndo: () => ViewModel.TimeEntriesViewModel.CancelDeleteTimeEntry.Execute(Unit.Default), text: undoText); snackBar.SnackBottomAnchor = StartTimeEntryButton.TopAnchor; snackBar.Show(superView: View); }