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 @@ + + + + + + + + + + + + + + + + + + + + + +