Ejemplo n.º 1
0
        private void AddLabelCommandOnExecute()
        {
            BeginEdit();

            var newLabel = new CustomLabelViewModel(new CustomLabel(), _dialogService, _audioSession, MessageBus)
            {
                Name = "New Label"
            };

            CustomLabels.Add(newLabel);

            _added.Add(newLabel);
        }
Ejemplo n.º 2
0
        private void RemoveLabelCommandOnExecute(CustomLabelViewModel labelViewModel)
        {
            BeginEdit();

            if (!_dialogService.ShowConfirmationDialog(ConfirmationDialogType.DeleteLabel, labelViewModel.Name))
            {
                return;
            }

            CustomLabels.Remove(labelViewModel);

            // Only add to removed if not a new label
            if (!_added.Remove(labelViewModel))
            {
                _removed.Add(labelViewModel);
            }
        }