private async void ExecuteDelete(IJobViewModel vm) { if (vm == null) { throw new ArgumentNullException(nameof(vm)); } MessageDialogResult dialogResult = await DialogService.ShowMessageAsync(this, "Delete Job", string.Format("Are you sure you want to delete {0}?", vm.Name), MessageDialogStyle.AffirmativeAndNegative); if (dialogResult != MessageDialogResult.Affirmative) { return; } vm.DeleteJob(); Jobs.Remove(vm); SelectedJob = null; }
private async void ExecuteDelete(IJobViewModel vm) { if (vm == null) throw new ArgumentNullException(nameof(vm)); MessageDialogResult dialogResult = await DialogService.ShowMessageAsync(this, "Delete Job", string.Format("Are you sure you want to delete {0}?", vm.Name), MessageDialogStyle.AffirmativeAndNegative); if (dialogResult != MessageDialogResult.Affirmative) return; vm.DeleteJob(); Jobs.Remove(vm); SelectedJob = null; }