private void CheckIsStrategyChanged() { if (!DiagramEditorControl.IsChanged) { return; } var element = DiagramEditorControl.Composition; if (MessageBox.Show("Element {0} was changed. Save?".Put(element.Name), Title, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { _strategiesRegistry.Save(element, _isCompositionSelected); } else { _strategiesRegistry.Discard(element, _isCompositionSelected); } }
private void DiscardCommand_OnExecuted(object sender, ExecutedRoutedEventArgs e) { var diagramEditor = (DiagramEditorControl)DockingManager.ActiveContent; var item = diagramEditor.Composition; var discardedItem = _strategiesRegistry.Discard(item); diagramEditor.Composition = discardedItem; diagramEditor.ResetIsChanged(); }