private void AddLabelCommandOnExecute() { BeginEdit(); var newLabel = new CustomLabelViewModel(new CustomLabel(), _dialogService, _audioSession, MessageBus) { Name = "New Label" }; CustomLabels.Add(newLabel); _added.Add(newLabel); }
private void RemoveLabelCommandOnExecute(CustomLabelViewModel labelViewModel) { if (!_dialogService.ShowConfirmationDialog(ConfirmationDialogType.DeleteLabel, labelViewModel.Name)) { return; } BeginEdit(); CustomLabels.Remove(labelViewModel); // Only add to removed if not a new label if (!_added.Remove(labelViewModel)) { _removed.Add(labelViewModel); } }