public async void BackKeyPress() { if (string.IsNullOrEmpty(PlotViewModel.Description)) { await PlotViewModel.DeleteAll(); } }
private async Task <bool> Discard() { if (string.IsNullOrEmpty(PlotViewModel.Description)) { var result = MessageBox.Show("Are you sure you want to discard the result?", "Confirmation", MessageBoxButton.OKCancel); if (result != MessageBoxResult.OK) { return(false); } await PlotViewModel.DeleteAll(); return(true); } return(true); }