From 99666562690bd036bf2a194fcc79aa7d779e3785 Mon Sep 17 00:00:00 2001 From: kwai Date: Wed, 1 Mar 2023 19:28:06 +0800 Subject: [PATCH] mind --- .../AIStudio.Wpf.DiagramDesigner.Demo.csproj | 1 + .../MainWindow.xaml.cs | 1 + .../ViewModels/MindEditorViewModel.cs | 93 +++++++++++++++++++ .../Views/MindEditorView.xaml | 49 ++++++++++ .../Views/MindEditorView.xaml.cs | 26 ++++++ .../Models/Serializables/DesignerItemBase.cs | 15 +++ .../DesignerItemViewModelBase.cs | 28 ++++++ AIStudio.Wpf.Mind/AIStudio.Wpf.Mind.csproj | 2 +- AIStudio.Wpf.Mind/Controls/MindEditor.xaml | 44 +++++++++ .../{MindEditor.cs => MindEditor.xaml.cs} | 20 ++++ .../Controls/ToolBoxControl.xaml | 37 ++++++++ .../Controls/ToolBoxControl.xaml.cs | 26 ++++++ .../Models/MindNodeDesignerItem.cs | 84 +++++++++++++++++ AIStudio.Wpf.Mind/Models/MindNodeModel.cs | 51 ++++++++++ AIStudio.Wpf.Mind/Properties/AssemblyInfo.cs | 7 ++ AIStudio.Wpf.Mind/Themes/Generic.xaml | 2 +- AIStudio.Wpf.Mind/ViewModels/MindNode.cs | 69 ++++++++------ 17 files changed, 525 insertions(+), 30 deletions(-) create mode 100644 AIStudio.Wpf.DiagramDesigner.Demo/ViewModels/MindEditorViewModel.cs create mode 100644 AIStudio.Wpf.DiagramDesigner.Demo/Views/MindEditorView.xaml create mode 100644 AIStudio.Wpf.DiagramDesigner.Demo/Views/MindEditorView.xaml.cs create mode 100644 AIStudio.Wpf.Mind/Controls/MindEditor.xaml rename AIStudio.Wpf.Mind/Controls/{MindEditor.cs => MindEditor.xaml.cs} (91%) create mode 100644 AIStudio.Wpf.Mind/Controls/ToolBoxControl.xaml create mode 100644 AIStudio.Wpf.Mind/Controls/ToolBoxControl.xaml.cs create mode 100644 AIStudio.Wpf.Mind/Models/MindNodeDesignerItem.cs create mode 100644 AIStudio.Wpf.Mind/Models/MindNodeModel.cs diff --git a/AIStudio.Wpf.DiagramDesigner.Demo/AIStudio.Wpf.DiagramDesigner.Demo.csproj b/AIStudio.Wpf.DiagramDesigner.Demo/AIStudio.Wpf.DiagramDesigner.Demo.csproj index 61cbd25..d8d8023 100644 --- a/AIStudio.Wpf.DiagramDesigner.Demo/AIStudio.Wpf.DiagramDesigner.Demo.csproj +++ b/AIStudio.Wpf.DiagramDesigner.Demo/AIStudio.Wpf.DiagramDesigner.Demo.csproj @@ -13,6 +13,7 @@ + diff --git a/AIStudio.Wpf.DiagramDesigner.Demo/MainWindow.xaml.cs b/AIStudio.Wpf.DiagramDesigner.Demo/MainWindow.xaml.cs index f85da41..69803c2 100644 --- a/AIStudio.Wpf.DiagramDesigner.Demo/MainWindow.xaml.cs +++ b/AIStudio.Wpf.DiagramDesigner.Demo/MainWindow.xaml.cs @@ -124,6 +124,7 @@ namespace AIStudio.Wpf.DiagramDesigner.Demo Children=new List { new MenuItemViewModel(){Title = "FlowchartEditor"}, + new MenuItemViewModel(){Title = "MindEditor"}, } }, }; diff --git a/AIStudio.Wpf.DiagramDesigner.Demo/ViewModels/MindEditorViewModel.cs b/AIStudio.Wpf.DiagramDesigner.Demo/ViewModels/MindEditorViewModel.cs new file mode 100644 index 0000000..9bc8c86 --- /dev/null +++ b/AIStudio.Wpf.DiagramDesigner.Demo/ViewModels/MindEditorViewModel.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Text; +using AIStudio.Wpf.Flowchart; + +namespace AIStudio.Wpf.DiagramDesigner.Demo.ViewModels +{ + class MindEditorViewModel : BaseViewModel + { + public MindEditorViewModel() + { + Title = "MindEditor"; + Info = "Encapsulated mind controls"; + + GetDataCommand = new SimpleCommand(GetDataExcute); + SetDataCommand = new SimpleCommand(SetDataExcute); + } + + private Func _getDataFunc; + public Func GetDataFunc + { + get + { + return _getDataFunc; + } + set + { + SetProperty(ref _getDataFunc, value); + } + } + + private string _inputData; + public string InputData + { + get + { + return _inputData; + } + set + { + SetProperty(ref _inputData, value); + } + } + + private string _outputData; + public string OutputData + { + get + { + return _outputData; + } + set + { + SetProperty(ref _outputData, value); + } + } + + private string _data = "{}"; + public string Data + { + get + { + return _data; + } + set + { + SetProperty(ref _data, value); + } + } + + + public SimpleCommand GetDataCommand + { + get; private set; + } + + public SimpleCommand SetDataCommand + { + get; private set; + } + + private void GetDataExcute(object obj) + { + OutputData = GetDataFunc(); + } + + private void SetDataExcute(object obj) + { + Data = "{}"; + Data = InputData; + } + } +} diff --git a/AIStudio.Wpf.DiagramDesigner.Demo/Views/MindEditorView.xaml b/AIStudio.Wpf.DiagramDesigner.Demo/Views/MindEditorView.xaml new file mode 100644 index 0000000..a103e68 --- /dev/null +++ b/AIStudio.Wpf.DiagramDesigner.Demo/Views/MindEditorView.xaml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + +