From 84f413320f8f22236bcda7cd00fa5d3929ae306d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=89=BE=E7=AB=B9?= Date: Sat, 11 Mar 2023 12:40:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E5=AD=98=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...iagramDesigner.Demo_h03cu4f5_wpftmp.csproj | 333 ++++++++++++++++++ .../UserControls/DiagramControl.xaml | 5 +- .../Controls/DropDownButton.xaml | 42 +++ AIStudio.Wpf.Mind/Controls/LinkControl.xaml | 12 + .../Controls/LinkControl.xaml.cs | 28 ++ AIStudio.Wpf.Mind/Controls/MindEditor.xaml.cs | 5 +- .../Controls/PriorityControl.xaml | 12 + .../Controls/PriorityControl.xaml.cs | 28 ++ AIStudio.Wpf.Mind/Controls/RateControl.xaml | 12 + .../Controls/RateControl.xaml.cs | 28 ++ AIStudio.Wpf.Mind/Controls/RemarkControl.xaml | 12 + .../Controls/RemarkControl.xaml.cs | 28 ++ AIStudio.Wpf.Mind/Controls/TagControl.xaml | 12 + AIStudio.Wpf.Mind/Controls/TagControl.xaml.cs | 28 ++ .../Controls/ToolBoxControl.xaml | 41 ++- AIStudio.Wpf.Mind/Themes/MindNode.xaml | 149 ++------ .../ViewModels/MindDiagramViewModel.cs | 131 ++++++- AIStudio.Wpf.Mind/ViewModels/MindNode.cs | 1 + 18 files changed, 763 insertions(+), 144 deletions(-) create mode 100644 AIStudio.Wpf.DiagramDesigner.Demo/AIStudio.Wpf.DiagramDesigner.Demo_h03cu4f5_wpftmp.csproj create mode 100644 AIStudio.Wpf.Mind/Controls/LinkControl.xaml create mode 100644 AIStudio.Wpf.Mind/Controls/LinkControl.xaml.cs create mode 100644 AIStudio.Wpf.Mind/Controls/PriorityControl.xaml create mode 100644 AIStudio.Wpf.Mind/Controls/PriorityControl.xaml.cs create mode 100644 AIStudio.Wpf.Mind/Controls/RateControl.xaml create mode 100644 AIStudio.Wpf.Mind/Controls/RateControl.xaml.cs create mode 100644 AIStudio.Wpf.Mind/Controls/RemarkControl.xaml create mode 100644 AIStudio.Wpf.Mind/Controls/RemarkControl.xaml.cs create mode 100644 AIStudio.Wpf.Mind/Controls/TagControl.xaml create mode 100644 AIStudio.Wpf.Mind/Controls/TagControl.xaml.cs diff --git a/AIStudio.Wpf.DiagramDesigner.Demo/AIStudio.Wpf.DiagramDesigner.Demo_h03cu4f5_wpftmp.csproj b/AIStudio.Wpf.DiagramDesigner.Demo/AIStudio.Wpf.DiagramDesigner.Demo_h03cu4f5_wpftmp.csproj new file mode 100644 index 0000000..7dcc733 --- /dev/null +++ b/AIStudio.Wpf.DiagramDesigner.Demo/AIStudio.Wpf.DiagramDesigner.Demo_h03cu4f5_wpftmp.csproj @@ -0,0 +1,333 @@ + + + AIStudio.Wpf.DiagramDesigner.Demo + obj\Debug\ + obj\ + F:\aistudio.-wpf.-diagram\AIStudio.Wpf.DiagramDesigner.Demo\obj\ + <_TargetAssemblyProjectName>AIStudio.Wpf.DiagramDesigner.Demo + + + + WinExe + true + + + + + + + + + + + + + + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AIStudio.Wpf.DiagramDesigner/UserControls/DiagramControl.xaml b/AIStudio.Wpf.DiagramDesigner/UserControls/DiagramControl.xaml index 648f27b..6f71932 100644 --- a/AIStudio.Wpf.DiagramDesigner/UserControls/DiagramControl.xaml +++ b/AIStudio.Wpf.DiagramDesigner/UserControls/DiagramControl.xaml @@ -860,7 +860,6 @@ - @@ -900,13 +899,13 @@ + Margin="5,0,0,5" /> diff --git a/AIStudio.Wpf.Mind/Controls/DropDownButton.xaml b/AIStudio.Wpf.Mind/Controls/DropDownButton.xaml index ff896ae..fe019b9 100644 --- a/AIStudio.Wpf.Mind/Controls/DropDownButton.xaml +++ b/AIStudio.Wpf.Mind/Controls/DropDownButton.xaml @@ -7,6 +7,47 @@ + + - + @@ -53,12 +54,36 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,125 +103,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs b/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs index f3f8cf3..3e38f17 100644 --- a/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs +++ b/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs @@ -89,6 +89,87 @@ namespace AIStudio.Wpf.Mind.ViewModels } } + private SimpleCommand _addLinkCommand; + public SimpleCommand AddLinkCommand + { + get + { + return this._addLinkCommand ?? (this._addLinkCommand = new SimpleCommand(MindExecuteEnable, ExecuteAddLinkCommand)); + } + } + + private SimpleCommand _removeLinkCommand; + public SimpleCommand RemoveLinkCommand + { + get + { + return this._removeLinkCommand ?? (this._removeLinkCommand = new SimpleCommand(MindExecuteEnable, ExecuteRemoveLinkCommand)); + } + } + + private SimpleCommand _addImageCommand; + public SimpleCommand AddImageCommand + { + get + { + return this._addImageCommand ?? (this._addImageCommand = new SimpleCommand(MindExecuteEnable, ExecuteAddImageCommand)); + } + } + + private SimpleCommand _removeImageCommand; + public SimpleCommand RemoveImageCommand + { + get + { + return this._removeImageCommand ?? (this._removeImageCommand = new SimpleCommand(MindExecuteEnable, ExecuteRemoveImageCommand)); + } + } + + private SimpleCommand _addRemarkCommand; + public SimpleCommand AddRemarkCommand + { + get + { + return this._addRemarkCommand ?? (this._addRemarkCommand = new SimpleCommand(MindExecuteEnable, ExecuteAddRemarkCommand)); + } + } + + private SimpleCommand _removeRemarkCommand; + public SimpleCommand RemoveRemarkCommand + { + get + { + return this._removeRemarkCommand ?? (this._removeRemarkCommand = new SimpleCommand(MindExecuteEnable, ExecuteRemoveRemarkCommand)); + } + } + + private SimpleCommand _addPriorityCommand; + public SimpleCommand AddPriorityCommand + { + get + { + return this._addPriorityCommand ?? (this._addPriorityCommand = new SimpleCommand(MindExecuteEnable, ExecuteAddPriorityCommand)); + } + } + + private SimpleCommand _addRatioCommand; + public SimpleCommand AddRatioCommand + { + get + { + return this._addRatioCommand ?? (this._addRatioCommand = new SimpleCommand(MindExecuteEnable, ExecuteAddRatioCommand)); + } + } + + private SimpleCommand _addTagCommand; + public SimpleCommand AddTagCommand + { + get + { + return this._addTagCommand ?? (this._addTagCommand = new SimpleCommand(MindExecuteEnable, ExecuteAddTagCommand)); + } + } + private SimpleCommand _changeMindTypeCommand; public SimpleCommand ChangeMindTypeCommand { @@ -180,7 +261,7 @@ namespace AIStudio.Wpf.Mind.ViewModels public void InitRootItem() { - MindNode level1node = new MindNode(this) { Root = this, Id = Guid.NewGuid(), Left = 200, Top = 200, Text = "思维导图" }; + MindNode level1node = new MindNode(this) { Root = this, Id = Guid.NewGuid(), Left = 500, Top = 500, Text = "思维导图" }; level1node.InitLayout(true); Items.Add(level1node); level1node.IsSelected = true; @@ -454,8 +535,56 @@ namespace AIStudio.Wpf.Mind.ViewModels } else return false; + } + private void ExecuteAddLinkCommand(object obj) + { + throw new NotImplementedException(); + } + private void ExecuteRemoveLinkCommand(object obj) + { + throw new NotImplementedException(); + } + + private void ExecuteAddImageCommand(object obj) + { + throw new NotImplementedException(); + } + + private void ExecuteRemoveImageCommand(object obj) + { + throw new NotImplementedException(); + } + + private void ExecuteAddRemarkCommand(object obj) + { + throw new NotImplementedException(); + } + + private void ExecuteRemoveRemarkCommand(object obj) + { + throw new NotImplementedException(); + } + + private void ExecuteAddPriorityCommand(object obj) + { + throw new NotImplementedException(); + } + + private void ExecuteAddRatioCommand(object obj) + { + throw new NotImplementedException(); + } + + private void ExecuteAddTagCommand(object obj) + { + throw new NotImplementedException(); + } + + private void ExecuteRemoveTagCommand(object obj) + { + throw new NotImplementedException(); } private void ExecutedChangeMindTypeCommand(object obj) diff --git a/AIStudio.Wpf.Mind/ViewModels/MindNode.cs b/AIStudio.Wpf.Mind/ViewModels/MindNode.cs index 003d775..f64e365 100644 --- a/AIStudio.Wpf.Mind/ViewModels/MindNode.cs +++ b/AIStudio.Wpf.Mind/ViewModels/MindNode.cs @@ -55,6 +55,7 @@ namespace AIStudio.Wpf.Mind.ViewModels EnabledForConnection = false; AlwayForResized = true; + CustomText = true; AddChildCommand = (Root as IMindDiagramViewModel)?.AddChildCommand; AddParentCommand = (Root as IMindDiagramViewModel)?.AddParentCommand;