From bdf7385a39b2731af21bc8a7813149356f9f3e21 Mon Sep 17 00:00:00 2001 From: kwai Date: Fri, 16 Jun 2023 19:20:44 +0800 Subject: [PATCH] xx --- .../BaseViewModel/DiagramViewModel.cs | 60 +++++++++++++++++++ .../BlockDesignerItemViewModel.cs | 3 +- .../ViewModels/MindDiagramViewModel.cs | 2 +- 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs b/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs index 915f25c..136c5bc 100644 --- a/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs +++ b/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/DiagramViewModel.cs @@ -813,6 +813,42 @@ namespace AIStudio.Wpf.DiagramDesigner return this._replaceAllCommand ?? (this._replaceAllCommand = new SimpleCommand(ExecuteEnable, this.ExecutedSearchReplaceAllCommand)); } } + + private ICommand _addNextCommand; + public ICommand AddNextCommand + { + get + { + return this._addNextCommand ?? (this._addNextCommand = new SimpleCommand(ExecuteEnable, this.ExecutedAddNextCommand)); + } + } + + private ICommand _removeNextCommand; + public ICommand RemoveNextCommand + { + get + { + return this._removeNextCommand ?? (this._removeNextCommand = new SimpleCommand(ExecuteEnable, this.ExecutedRemoveNextCommand)); + } + } + + private ICommand _addChildCommand; + public ICommand AddChildCommand + { + get + { + return this._addChildCommand ?? (this._addChildCommand = new SimpleCommand(ExecuteEnable, this.ExecutedAddChildCommand)); + } + } + + private ICommand _removeChildCommand; + public ICommand RemoveChildCommand + { + get + { + return this._removeChildCommand ?? (this._removeChildCommand = new SimpleCommand(ExecuteEnable, this.ExecutedRemoveChildCommand)); + } + } #endregion #region ctor和初始化 @@ -1520,6 +1556,30 @@ namespace AIStudio.Wpf.DiagramDesigner } #endregion + #region Block使用 + private void ExecutedAddNextCommand(object parameter) + { + if (parameter is Tuple blockTuple) + { + } + + } + + private void ExecutedRemoveNextCommand(object parameter) + { + + } + + private void ExecutedAddChildCommand(object parameter) + { + + } + private void ExecutedRemoveChildCommand(object parameter) + { + + } + #endregion + #region 布局 private void ExecuteAlignTopCommand(object parameter) { diff --git a/AIStudio.Wpf.DiagramDesigner/ViewModels/DefaultViewModel/BlockDesignerItemViewModel.cs b/AIStudio.Wpf.DiagramDesigner/ViewModels/DefaultViewModel/BlockDesignerItemViewModel.cs index de3db7a..41f9f87 100644 --- a/AIStudio.Wpf.DiagramDesigner/ViewModels/DefaultViewModel/BlockDesignerItemViewModel.cs +++ b/AIStudio.Wpf.DiagramDesigner/ViewModels/DefaultViewModel/BlockDesignerItemViewModel.cs @@ -129,8 +129,7 @@ namespace AIStudio.Wpf.DiagramDesigner System.Windows.Application.Current?.Dispatcher.BeginInvoke(new Action(async () => { await Task.Delay(10); AlignNext(this.Next); - })); - + })); } public virtual void RemoveChild(BlockDesignerItemViewModel child) diff --git a/Extensions/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs b/Extensions/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs index 9b9c9c4..7868300 100644 --- a/Extensions/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs +++ b/Extensions/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs @@ -125,7 +125,7 @@ namespace AIStudio.Wpf.Mind.ViewModels } private ICommand _addChildCommand; - public ICommand AddChildCommand + public new ICommand AddChildCommand { get {