Skip to content

Commit

Permalink
Delete confirmation message box. (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
puppetsw authored Sep 14, 2022
1 parent 6a2791a commit a82e6ac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/StringMaster/ViewModels/StringCogoPointsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,18 @@ private void RemoveRow()
return;

if (SelectedKey != null)
DescriptionKeys?.Remove(SelectedKey);
{
if (SelectedKey.IsValid())
{
var dialog = _messageBoxService.ShowYesNo("Delete", "Remove this description key? This cannot be undone.");
if (dialog == true)
DescriptionKeys?.Remove(SelectedKey);
}
else
{
DescriptionKeys?.Remove(SelectedKey);
}
}

IsUnsavedChanges = true;
DescriptionKeyPropertyChanged(null, null);
Expand Down

0 comments on commit a82e6ac

Please sign in to comment.