From 152c6a8c22f3c93093e80d4e7cdd76db8f691317 Mon Sep 17 00:00:00 2001 From: kwai Date: Mon, 6 Mar 2023 11:54:41 +0800 Subject: [PATCH] xx --- .../BaseViewModel/DiagramViewModel.cs | 358 ++++++++++++------ .../ViewModels/IDiagramViewModel.cs | 7 +- .../Controls/ToolBoxControl.xaml | 6 + .../ViewModels/IMindDiagramViewModel.cs | 35 ++ .../ViewModels/MindDiagramViewModel.cs | 170 ++++++--- 5 files changed, 422 insertions(+), 154 deletions(-) diff --git a/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs b/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs index f6a55d2..61078d6 100644 --- a/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs +++ b/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs @@ -576,169 +576,346 @@ namespace AIStudio.Wpf.DiagramDesigner #endregion #region 命令 + private SimpleCommand _createNewDiagramCommand; public SimpleCommand CreateNewDiagramCommand { - get; private set; + get + { + return this._createNewDiagramCommand ?? (this._createNewDiagramCommand = new SimpleCommand(ExecuteEnable, ExecuteCreateNewDiagramCommand)); + } } + + private SimpleCommand _directAddItemCommand; public SimpleCommand DirectAddItemCommand { - get; private set; + get + { + return this._directAddItemCommand ?? (this._directAddItemCommand = new SimpleCommand(ExecuteEnable, ExecuteDirectAddItemCommand)); + } } + + private SimpleCommand _addItemCommand; public SimpleCommand AddItemCommand { - get; private set; + get + { + return this._addItemCommand ?? (this._addItemCommand = new SimpleCommand(ExecuteEnable, ExecuteAddItemCommand)); + } } + + private SimpleCommand _directRemoveItemCommand; public SimpleCommand DirectRemoveItemCommand { - get; private set; + get + { + return this._directRemoveItemCommand ?? (this._directRemoveItemCommand = new SimpleCommand(ExecuteEnable, ExecuteDirectRemoveItemCommand)); + } } + + private SimpleCommand _removeItemCommand; public SimpleCommand RemoveItemCommand { - get; private set; + get + { + return this._removeItemCommand ?? (this._removeItemCommand = new SimpleCommand(ExecuteEnable, ExecuteRemoveItemCommand)); + } } + + private SimpleCommand _clearSelectedItemsCommand; public SimpleCommand ClearSelectedItemsCommand { - get; private set; + get + { + return this._clearSelectedItemsCommand ?? (this._clearSelectedItemsCommand = new SimpleCommand(ExecuteEnable, ExecuteClearSelectedItemsCommand)); + } } + + private SimpleCommand _alignTopCommand; public SimpleCommand AlignTopCommand { - get; private set; + get + { + return this._alignTopCommand ?? (this._alignTopCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignTopCommand)); + } } + + private SimpleCommand _alignVerticalCentersCommand; public SimpleCommand AlignVerticalCentersCommand { - get; private set; + get + { + return this._alignVerticalCentersCommand ?? (this._alignVerticalCentersCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignVerticalCentersCommand)); + } } + + private SimpleCommand _alignBottomCommand; public SimpleCommand AlignBottomCommand { - get; private set; + get + { + return this._alignBottomCommand ?? (this._alignBottomCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignBottomCommand)); + } } + + private SimpleCommand _alignLeftCommand; public SimpleCommand AlignLeftCommand { - get; private set; + get + { + return this._alignLeftCommand ?? (this._alignLeftCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignLeftCommand)); + } } + + private SimpleCommand _alignHorizontalCentersCommand; public SimpleCommand AlignHorizontalCentersCommand { - get; private set; + get + { + return this._alignHorizontalCentersCommand ?? (this._alignHorizontalCentersCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignHorizontalCentersCommand)); + } } + + private SimpleCommand _alignRightCommand; public SimpleCommand AlignRightCommand { - get; private set; + get + { + return this._alignRightCommand ?? (this._alignRightCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignRightCommand)); + } } + + private SimpleCommand _bringForwardCommand; public SimpleCommand BringForwardCommand { - get; private set; + get + { + return this._bringForwardCommand ?? (this._bringForwardCommand = new SimpleCommand(ExecuteEnable, ExecuteBringForwardCommand)); + } } + + private SimpleCommand _bringToFrontCommand; public SimpleCommand BringToFrontCommand { - get; private set; + get + { + return this._bringToFrontCommand ?? (this._bringToFrontCommand = new SimpleCommand(ExecuteEnable, ExecuteBringToFrontCommand)); + } } + + private SimpleCommand _sendBackwardCommand; public SimpleCommand SendBackwardCommand { - get; private set; + get + { + return this._sendBackwardCommand ?? (this._sendBackwardCommand = new SimpleCommand(ExecuteEnable, ExecuteSendBackwardCommand)); + } } + + private SimpleCommand _sendToBackCommand; public SimpleCommand SendToBackCommand { - get; private set; + get + { + return this._sendToBackCommand ?? (this._sendToBackCommand = new SimpleCommand(ExecuteEnable, ExecuteSendToBackCommand)); + } } + private SimpleCommand _distributeHorizontalCommand; public SimpleCommand DistributeHorizontalCommand { - get; private set; + get + { + return this._distributeHorizontalCommand ?? (this._distributeHorizontalCommand = new SimpleCommand(ExecuteEnable, ExecuteDistributeHorizontalCommand)); + } } + + private SimpleCommand _distributeVerticalCommand; public SimpleCommand DistributeVerticalCommand { - get; private set; + get + { + return this._distributeVerticalCommand ?? (this._distributeVerticalCommand = new SimpleCommand(ExecuteEnable, ExecuteDistributeVerticalCommand)); + } } + + private SimpleCommand _selectAllCommand; public SimpleCommand SelectAllCommand { - get; private set; + get + { + return this._selectAllCommand ?? (this._selectAllCommand = new SimpleCommand(ExecuteEnable, ExecuteSelectAllCommand)); + } } + private SimpleCommand _selectItemCommand; public SimpleCommand SelectItemCommand { - get; private set; + get + { + return this._selectItemCommand ?? (this._selectItemCommand = new SimpleCommand(ExecuteEnable, ExecuteSelectItemCommand)); + } } + private SimpleCommand _copyCommand; public SimpleCommand CopyCommand { - get; private set; + get + { + return this._copyCommand ?? (this._copyCommand = new SimpleCommand(ExecuteEnable, ExecuteCopyCommand)); + } } + private SimpleCommand _pasteCommand; public SimpleCommand PasteCommand { - get; private set; + get + { + return this._pasteCommand ?? (this._pasteCommand = new SimpleCommand(ExecuteEnable, ExecutePasteCommand)); + } } + private SimpleCommand _cutCommand; public SimpleCommand CutCommand { - get; private set; + get + { + return this._cutCommand ?? (this._cutCommand = new SimpleCommand(ExecuteEnable, ExecuteCutCommand)); + } } + private SimpleCommand _deleteCommand; public SimpleCommand DeleteCommand { - get; private set; + get + { + return this._deleteCommand ?? (this._deleteCommand = new SimpleCommand(ExecuteEnable, ExecuteDeleteCommand)); + } } + private SimpleCommand _leftMoveCommand; public SimpleCommand LeftMoveCommand { - get; private set; + get + { + return this._leftMoveCommand ?? (this._leftMoveCommand = new SimpleCommand(ExecuteEnable, ExecuteLeftMoveCommand)); + } } + private SimpleCommand _rightMoveCommand; public SimpleCommand RightMoveCommand { - get; private set; + get + { + return this._rightMoveCommand ?? (this._rightMoveCommand = new SimpleCommand(ExecuteEnable, ExecuteRightMoveCommand)); + } } + private SimpleCommand _upMoveCommand; public SimpleCommand UpMoveCommand { - get; private set; + get + { + return this._upMoveCommand ?? (this._upMoveCommand = new SimpleCommand(ExecuteEnable, ExecuteUpMoveCommand)); + } } + private SimpleCommand _downMoveCommand; public SimpleCommand DownMoveCommand { - get; private set; + get + { + return this._downMoveCommand ?? (this._downMoveCommand = new SimpleCommand(ExecuteEnable, ExecuteDownMoveCommand)); + } } + private SimpleCommand _centerMoveCommand; public SimpleCommand CenterMoveCommand { - get; private set; - } - public SimpleCommand SameSizeCommand - { - get; private set; - } - public SimpleCommand SameWidthCommand - { - get; private set; - } - public SimpleCommand SameHeightCommand - { - get; private set; - } - public SimpleCommand SameAngleCommand - { - get; private set; - } - public SimpleCommand GroupCommand - { - get; private set; - } - public SimpleCommand UngroupCommand - { - get; private set; - } - public SimpleCommand LockCommand - { - get; private set; - } - public SimpleCommand UnlockCommand - { - get; private set; + get + { + return this._centerMoveCommand ?? (this._centerMoveCommand = new SimpleCommand(ExecuteEnable, ExecuteCenterMoveCommand)); + } } + private SimpleCommand _sameSizeCommand; + public SimpleCommand SameSizeCommand + { + get + { + return this._sameSizeCommand ?? (this._sameSizeCommand = new SimpleCommand(ExecuteEnable, ExecuteSameSizeCommand)); + } + } + + private SimpleCommand _sameWidthCommand; + public SimpleCommand SameWidthCommand + { + get + { + return this._sameWidthCommand ?? (this._sameWidthCommand = new SimpleCommand(ExecuteEnable, ExecuteSameWidthCommand)); + } + } + + private SimpleCommand _sameHeightCommand; + public SimpleCommand SameHeightCommand + { + get + { + return this._sameHeightCommand ?? (this._sameHeightCommand = new SimpleCommand(ExecuteEnable, ExecuteSameHeightCommand)); + } + } + + private SimpleCommand _sameAngleCommand; + public SimpleCommand SameAngleCommand + { + get + { + return this._sameAngleCommand ?? (this._sameAngleCommand = new SimpleCommand(ExecuteEnable, ExecuteSameAngleCommand)); + } + } + + private SimpleCommand _groupCommand; + public SimpleCommand GroupCommand + { + get + { + return this._groupCommand ?? (this._groupCommand = new SimpleCommand(ExecuteEnable, ExecuteGroupCommand)); + } + } + + private SimpleCommand _ungroupCommand; + public SimpleCommand UngroupCommand + { + get + { + return this._ungroupCommand ?? (this._ungroupCommand = new SimpleCommand(ExecuteEnable, ExecuteUngroupCommand)); + } + } + + private SimpleCommand _lockCommand; + public SimpleCommand LockCommand + { + get + { + return this._lockCommand ?? (this._lockCommand = new SimpleCommand(ExecuteEnable, ExecuteLockCommand)); + } + } + + private SimpleCommand _unlockCommand; + public SimpleCommand UnlockCommand + { + get + { + return this._unlockCommand ?? (this._unlockCommand = new SimpleCommand(ExecuteEnable, ExecuteUnlockCommand)); + } + } + + private SimpleCommand _editCommand; public SimpleCommand EditCommand { - get; private set; + get + { + return this._editCommand ?? (this._editCommand = new SimpleCommand(ExecuteEnable, ExecuteEditCommand)); + } } private SimpleCommand _undoCommand; @@ -746,7 +923,7 @@ namespace AIStudio.Wpf.DiagramDesigner { get { - return this._undoCommand ?? (this._undoCommand = new SimpleCommand(Undo_Enabled, this.UndoExecuted)); + return this._undoCommand ?? (this._undoCommand = new SimpleCommand(Undo_Enabled, this.ExecutedUndoCommand)); } } @@ -755,7 +932,7 @@ namespace AIStudio.Wpf.DiagramDesigner { get { - return this._redoCommand ?? (this._redoCommand = new SimpleCommand(Redo_Enabled, this.RedoExecuted)); + return this._redoCommand ?? (this._redoCommand = new SimpleCommand(Redo_Enabled, this.ExecutedRedoCommand)); } } #endregion @@ -768,45 +945,6 @@ namespace AIStudio.Wpf.DiagramDesigner public DiagramViewModel() { - CreateNewDiagramCommand = new SimpleCommand(ExecuteEnable, ExecuteCreateNewDiagramCommand); - AddItemCommand = new SimpleCommand(ExecuteEnable, ExecuteAddItemCommand); - DirectAddItemCommand = new SimpleCommand(ExecuteEnable, ExecuteDirectAddItemCommand); - RemoveItemCommand = new SimpleCommand(ExecuteEnable, ExecuteRemoveItemCommand); - DirectRemoveItemCommand = new SimpleCommand(ExecuteEnable, ExecuteDirectRemoveItemCommand); - ClearSelectedItemsCommand = new SimpleCommand(ExecuteEnable, ExecuteClearSelectedItemsCommand); - - AlignTopCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignTopCommand); - AlignVerticalCentersCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignVerticalCentersCommand); - AlignBottomCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignBottomCommand); - AlignLeftCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignLeftCommand); - AlignHorizontalCentersCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignHorizontalCentersCommand); - AlignRightCommand = new SimpleCommand(ExecuteEnable, ExecuteAlignRightCommand); - BringForwardCommand = new SimpleCommand(ExecuteEnable, ExecuteBringForwardCommand); - BringToFrontCommand = new SimpleCommand(ExecuteEnable, ExecuteBringToFrontCommand); - SendBackwardCommand = new SimpleCommand(ExecuteEnable, ExecuteSendBackwardCommand); - SendToBackCommand = new SimpleCommand(ExecuteEnable, ExecuteSendToBackCommand); - DistributeHorizontalCommand = new SimpleCommand(ExecuteEnable, ExecuteDistributeHorizontalCommand); - DistributeVerticalCommand = new SimpleCommand(ExecuteEnable, ExecuteDistributeVerticalCommand); - SelectAllCommand = new SimpleCommand(ExecuteEnable, ExecuteSelectAllCommand); - SelectItemCommand = new SimpleCommand(ExecuteEnable, ExecuteSelectItemCommand); - CopyCommand = new SimpleCommand(ExecuteEnable, ExecuteCopyCommand); - PasteCommand = new SimpleCommand(ExecuteEnable, ExecutePasteCommand); - CutCommand = new SimpleCommand(ExecuteEnable, ExecuteCutCommand); - DeleteCommand = new SimpleCommand(ExecuteEnable, ExecuteDeleteCommand); - LeftMoveCommand = new SimpleCommand(ExecuteEnable, ExecuteLeftMoveCommand); - RightMoveCommand = new SimpleCommand(ExecuteEnable, ExecuteRightMoveCommand); - UpMoveCommand = new SimpleCommand(ExecuteEnable, ExecuteUpMoveCommand); - DownMoveCommand = new SimpleCommand(ExecuteEnable, ExecuteDownMoveCommand); - CenterMoveCommand = new SimpleCommand(ExecuteEnable, ExecuteCenterMoveCommand); - SameSizeCommand = new SimpleCommand(ExecuteEnable, ExecuteSameSizeCommand); - SameWidthCommand = new SimpleCommand(ExecuteEnable, ExecuteSameWidthCommand); - SameHeightCommand = new SimpleCommand(ExecuteEnable, ExecuteSameHeightCommand); - SameAngleCommand = new SimpleCommand(ExecuteEnable, ExecuteSameAngleCommand); - GroupCommand = new SimpleCommand(ExecuteEnable, ExecuteGroupCommand); - UngroupCommand = new SimpleCommand(ExecuteEnable, ExecuteUngroupCommand); - LockCommand = new SimpleCommand(ExecuteEnable, ExecuteLockCommand); - UnlockCommand = new SimpleCommand(ExecuteEnable, ExecuteUnlockCommand); - EditCommand = new SimpleCommand(ExecuteEnable, ExecuteEditCommand); Mediator.Instance.Register(this); Items.CollectionChanged += Items_CollectionChanged; @@ -852,8 +990,8 @@ namespace AIStudio.Wpf.DiagramDesigner sender.SetPropertyValue(propertyName, oldvalue); } - - private void UndoExecuted(object para) + + private void ExecutedUndoCommand(object para) { Undo(para); } @@ -865,13 +1003,13 @@ namespace AIStudio.Wpf.DiagramDesigner { return false; } - + DoCommandManager.UnDo(); - + return true; } - private void RedoExecuted(object para) + private void ExecutedRedoCommand(object para) { Redo(para); } @@ -1140,7 +1278,7 @@ namespace AIStudio.Wpf.DiagramDesigner if (parameter is ISelectable selectable) { selectable.IsSelected = true; - } + } } #endregion @@ -2292,7 +2430,7 @@ namespace AIStudio.Wpf.DiagramDesigner if (SelectedItem != null) SelectedItem.ShowText = true; } - + } } } diff --git a/AIStudio.Wpf.DiagramDesigner/ViewModels/IDiagramViewModel.cs b/AIStudio.Wpf.DiagramDesigner/ViewModels/IDiagramViewModel.cs index 9f309be..16733ed 100644 --- a/AIStudio.Wpf.DiagramDesigner/ViewModels/IDiagramViewModel.cs +++ b/AIStudio.Wpf.DiagramDesigner/ViewModels/IDiagramViewModel.cs @@ -181,6 +181,11 @@ namespace AIStudio.Wpf.DiagramDesigner get; } + SimpleCommand EditCommand + { + get; + } + SimpleCommand UndoCommand { get; @@ -280,7 +285,7 @@ namespace AIStudio.Wpf.DiagramDesigner bool AllowDrop { get; set; - } + } System.Windows.Point CurrentPoint { get; set; diff --git a/AIStudio.Wpf.Mind/Controls/ToolBoxControl.xaml b/AIStudio.Wpf.Mind/Controls/ToolBoxControl.xaml index e3e749a..b56f1b9 100644 --- a/AIStudio.Wpf.Mind/Controls/ToolBoxControl.xaml +++ b/AIStudio.Wpf.Mind/Controls/ToolBoxControl.xaml @@ -166,6 +166,12 @@ + diff --git a/AIStudio.Wpf.Mind/ViewModels/IMindDiagramViewModel.cs b/AIStudio.Wpf.Mind/ViewModels/IMindDiagramViewModel.cs index c3968c9..845c8dc 100644 --- a/AIStudio.Wpf.Mind/ViewModels/IMindDiagramViewModel.cs +++ b/AIStudio.Wpf.Mind/ViewModels/IMindDiagramViewModel.cs @@ -58,5 +58,40 @@ namespace AIStudio.Wpf.Mind.ViewModels { get; } + + SimpleCommand ResetLayoutCommand + { + get; + } + + SimpleCommand Expand2Level1Command + { + get; + } + + SimpleCommand Expand2Level2Command + { + get; + } + + SimpleCommand Expand2Level3Command + { + get; + } + + SimpleCommand Expand2Level4Command + { + get; + } + + SimpleCommand Expand2Level5Command + { + get; + } + + SimpleCommand Expand2Level6Command + { + get; + } } } diff --git a/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs b/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs index 6b74941..ca436f7 100644 --- a/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs +++ b/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs @@ -34,39 +34,58 @@ namespace AIStudio.Wpf.Mind.ViewModels #endregion #region 命令 - public SimpleCommand AddRootCommand - { - get; private set; - } - + private SimpleCommand _addParentCommand; public SimpleCommand AddParentCommand { - get; private set; + get + { + return this._addParentCommand ?? (this._addParentCommand = new SimpleCommand(MindLevelEnable, ExecuteAddParentCommand)); + } } + private SimpleCommand _addChildCommand; public SimpleCommand AddChildCommand { - get; private set; + get + { + return this._addChildCommand ?? (this._addChildCommand = new SimpleCommand(MindExecuteEnable, this.ExecuteAddChildCommand)); + } } + private SimpleCommand _addPeerCommand; public SimpleCommand AddPeerCommand { - get; private set; + get + { + return this._addPeerCommand ?? (this._addPeerCommand = new SimpleCommand(MindLevelEnable, this.ExecuteAddPeerCommand)); + } } + private SimpleCommand _deleteSelfCommand; public SimpleCommand DeleteSelfCommand { - get; private set; + get + { + return this._deleteSelfCommand ?? (this._deleteSelfCommand = new SimpleCommand(MindLevelEnable, ExecuteDeleteSelfCommand)); + } } + private SimpleCommand _moveForwardCommand; public SimpleCommand MoveForwardCommand { - get; private set; + get + { + return this._moveForwardCommand ?? (this._moveForwardCommand = new SimpleCommand(MindExecuteEnable, ExecuteMoveForwardCommand)); + } } + private SimpleCommand _moveBackCommand; public SimpleCommand MoveBackCommand { - get; private set; + get + { + return this._moveBackCommand ?? (this._moveBackCommand = new SimpleCommand(MindExecuteEnable, ExecuteMoveBackCommand)); + } } private SimpleCommand _changeMindTypeCommand; @@ -78,56 +97,81 @@ namespace AIStudio.Wpf.Mind.ViewModels } } + private SimpleCommand _changeMindThemeCommand; public SimpleCommand ChangeMindThemeCommand { - get; private set; + get + { + return this._changeMindThemeCommand ?? (this._changeMindThemeCommand = new SimpleCommand(MindExecuteEnable, this.ExecutedChangeMindThemeCommand)); + } } - public SimpleCommand ResetLayout + private SimpleCommand _resetLayoutCommand; + public SimpleCommand ResetLayoutCommand { - get; private set; + get + { + return this._resetLayoutCommand ?? (this._resetLayoutCommand = new SimpleCommand(MindExecuteEnable, this.ExecutedResetLayoutCommand)); + } } - public SimpleCommand Expand2Level1 + private SimpleCommand _expand2Level1Command; + public SimpleCommand Expand2Level1Command { - get; private set; + get + { + return this._expand2Level1Command ?? (this._expand2Level1Command = new SimpleCommand(MindExecuteEnable, this.ExecutedExpand2Level1Command)); + } } - public SimpleCommand Expand2Level2 + private SimpleCommand _expand2Level2Command; + public SimpleCommand Expand2Level2Command { - get; private set; + get + { + return this._expand2Level2Command ?? (this._expand2Level2Command = new SimpleCommand(MindExecuteEnable, this.ExecutedExpand2Level2Command)); + } } - public SimpleCommand Expand2Level3 + private SimpleCommand _expand2Level3Command; + public SimpleCommand Expand2Level3Command { - get; private set; + get + { + return this._expand2Level3Command ?? (this._expand2Level3Command = new SimpleCommand(MindExecuteEnable, this.ExecutedExpand2Level3Command)); + } } - public SimpleCommand Expand2Level4 + private SimpleCommand _expand2Level4Command; + public SimpleCommand Expand2Level4Command { - get; private set; + get + { + return this._expand2Level4Command ?? (this._expand2Level4Command = new SimpleCommand(MindExecuteEnable, this.ExecutedExpand2Level4Command)); + } } - public SimpleCommand Expand2Level5 + private SimpleCommand _expand2Level5Command; + public SimpleCommand Expand2Level5Command { - get; private set; + get + { + return this._expand2Level5Command ?? (this._expand2Level5Command = new SimpleCommand(MindExecuteEnable, this.ExecutedExpand2Level5Command)); + } } - public SimpleCommand Expand2Level6 + private SimpleCommand _expand2Level6Command; + public SimpleCommand Expand2Level6Command { - get; private set; + get + { + return this._expand2Level6Command ?? (this._expand2Level6Command = new SimpleCommand(MindExecuteEnable, this.ExecutedExpand2Level6Command)); + } } #endregion public MindDiagramViewModel() { - AddChildCommand = new SimpleCommand(MindExecuteEnable, ExecuteAddChildCommand); - AddParentCommand = new SimpleCommand(MindLevelEnable, ExecuteAddParentCommand); - AddPeerCommand = new SimpleCommand(MindLevelEnable, ExecuteAddPeerCommand); - DeleteSelfCommand = new SimpleCommand(MindLevelEnable, ExecuteDeleteSelfCommand); - MoveForwardCommand = new SimpleCommand(MindExecuteEnable, ExecuteMoveForwardCommand); - MoveBackCommand = new SimpleCommand(MindExecuteEnable, ExecuteMoveBackCommand); - MindNode level1node = new MindNode(this) { Left = 200, Top = 200, Text = "思维导图" }; level1node.InitLayout(true); Items.Add(level1node); @@ -151,16 +195,6 @@ namespace AIStudio.Wpf.Mind.ViewModels } #region 操作 - private void ExecutedChangeMindTypeCommand(object obj) - { - if (obj is MindType mindType) - { - Items.OfType().ToList().ForEach(item => { item.InitLayout(true); }); - Items.OfType().ToList().ForEach(item => { item.InitConnectLayout(); }); - RootItem?.LayoutUpdated(); - } - } - public void ExecuteAddChildCommand(object parameter) { List items = new List(); @@ -393,6 +427,56 @@ namespace AIStudio.Wpf.Mind.ViewModels } } + + private void ExecutedChangeMindTypeCommand(object obj) + { + if (obj is MindType mindType) + { + Items.OfType().ToList().ForEach(item => { item.InitLayout(true); }); + Items.OfType().ToList().ForEach(item => { item.InitConnectLayout(); }); + RootItem?.LayoutUpdated(); + } + } + + private void ExecutedChangeMindThemeCommand(object obj) + { + + } + + private void ExecutedResetLayoutCommand(object obj) + { + throw new NotImplementedException(); + } + + private void ExecutedExpand2Level1Command(object obj) + { + throw new NotImplementedException(); + } + + private void ExecutedExpand2Level2Command(object obj) + { + throw new NotImplementedException(); + } + + private void ExecutedExpand2Level3Command(object obj) + { + throw new NotImplementedException(); + } + + private void ExecutedExpand2Level4Command(object obj) + { + throw new NotImplementedException(); + } + + private void ExecutedExpand2Level5Command(object obj) + { + throw new NotImplementedException(); + } + + private void ExecutedExpand2Level6Command(object obj) + { + throw new NotImplementedException(); + } #endregion }