private void EditDisplayElement() { var displayElement = CurrentDisplayElement; if (displayElement == null) { return; } var viewModel = new DisplayItemEditorViewModel { DisplayItem = displayElement }; var editor = new DisplayItemEditorView { DataContext = viewModel }; editor.ShowDialog(); }
/// <summary> /// The add element. /// </summary> private void AddElement() { var displayElement = new DisplayItem(); var viewModel = new DisplayItemEditorViewModel { DisplayItem = displayElement }; var editor = new DisplayItemEditorView { DataContext = viewModel }; editor.ShowDialog(); DisplayItems.Add(displayElement); CurrentDisplayElement = displayElement; }