From a015f9208ba28aa7b1cc0e216b9737c6d942d6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=89=BE=E7=AB=B9?= Date: Tue, 28 Feb 2023 22:07:40 +0800 Subject: [PATCH] =?UTF-8?q?Mind=E5=87=86=E5=A4=87=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E5=87=86=E5=A4=87=E5=88=86=E7=A6=BB=E5=87=BA?= =?UTF-8?q?model=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AIStudio.Wpf.Diagram.sln | 13 +- .../ViewModels/MindViewModel.cs | 4 +- .../AIStudio.Wpf.JsonModel.csproj | 14 ++ AIStudio.Wpf.Mind/Controls/MindEditor.cs | 187 ++++++++++++++++++ AIStudio.Wpf.Mind/Helpers/DirectoryLayout.cs | 1 - AIStudio.Wpf.Mind/Helpers/FishBoneLayout.cs | 99 ++++++---- AIStudio.Wpf.Mind/Helpers/MindLayout.cs | 1 - .../Helpers/OrganizationalLayout.cs | 1 - AIStudio.Wpf.Mind/NodeLevel.cs | 3 +- AIStudio.Wpf.Mind/Themes/MindNode.xaml | 3 - AIStudio.Wpf.Mind/ViewModels/MindNode.cs | 2 +- 11 files changed, 274 insertions(+), 54 deletions(-) create mode 100644 AIStudio.Wpf.JsonModel/AIStudio.Wpf.JsonModel.csproj create mode 100644 AIStudio.Wpf.Mind/Controls/MindEditor.cs diff --git a/AIStudio.Wpf.Diagram.sln b/AIStudio.Wpf.Diagram.sln index 3819309..7cade39 100644 --- a/AIStudio.Wpf.Diagram.sln +++ b/AIStudio.Wpf.Diagram.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31727.386 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33205.214 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.Flowchart", "AIStudio.Wpf.Flowchart\AIStudio.Wpf.Flowchart.csproj", "{86ED5B40-D185-4AFA-B5BD-BC8E78DB8758}" EndProject @@ -27,7 +27,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.DiagramDesigner.Additionals", "AIStudio.Wpf.DiagramDesigner.Additionals\AIStudio.Wpf.DiagramDesigner.Additionals.csproj", "{186F34AC-4BC5-40E1-911B-DD3E96AECE6E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIStudio.Wpf.Mind", "AIStudio.Wpf.Mind\AIStudio.Wpf.Mind.csproj", "{85C437B9-16D2-4076-ABCD-52029AC232FC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.Mind", "AIStudio.Wpf.Mind\AIStudio.Wpf.Mind.csproj", "{85C437B9-16D2-4076-ABCD-52029AC232FC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIStudio.Wpf.JsonModel", "AIStudio.Wpf.JsonModel\AIStudio.Wpf.JsonModel.csproj", "{5384BE3D-A696-47C6-967E-6D56A7ABC18B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -67,6 +69,10 @@ Global {85C437B9-16D2-4076-ABCD-52029AC232FC}.Debug|Any CPU.Build.0 = Debug|Any CPU {85C437B9-16D2-4076-ABCD-52029AC232FC}.Release|Any CPU.ActiveCfg = Release|Any CPU {85C437B9-16D2-4076-ABCD-52029AC232FC}.Release|Any CPU.Build.0 = Release|Any CPU + {5384BE3D-A696-47C6-967E-6D56A7ABC18B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5384BE3D-A696-47C6-967E-6D56A7ABC18B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5384BE3D-A696-47C6-967E-6D56A7ABC18B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5384BE3D-A696-47C6-967E-6D56A7ABC18B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -76,6 +82,7 @@ Global {CC68D39D-7935-4079-9CEB-FC2FD498D511} = {4959F170-02FB-4B7F-8F53-93DAF22713F9} {2AB69067-277E-4EE0-9949-8326A145EEE4} = {4959F170-02FB-4B7F-8F53-93DAF22713F9} {85C437B9-16D2-4076-ABCD-52029AC232FC} = {4959F170-02FB-4B7F-8F53-93DAF22713F9} + {5384BE3D-A696-47C6-967E-6D56A7ABC18B} = {4959F170-02FB-4B7F-8F53-93DAF22713F9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D30FC641-F06C-4E35-AEA5-48A9B6E59CE0} diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs index a807a87..09a0434 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs @@ -55,10 +55,8 @@ namespace AIStudio.Wpf.Flowchart base.Init(); MindNode level1node = new MindNode(DiagramViewModel, Mind.NodeLevel.Level1, MindType) { Text = "思维导图" }; - level1node.Left = 15; - level1node.Top = 200; DiagramViewModel.DirectAddItemCommand.Execute(level1node); - //DiagramViewModel.CenterMoveCommand.Execute(level1node); + DiagramViewModel.CenterMoveCommand.Execute(level1node); MindNode level2node1_1 = new MindNode(DiagramViewModel, Mind.NodeLevel.Level2, MindType) { Text = "分支主题1" }; level1node.AddChild(level2node1_1); diff --git a/AIStudio.Wpf.JsonModel/AIStudio.Wpf.JsonModel.csproj b/AIStudio.Wpf.JsonModel/AIStudio.Wpf.JsonModel.csproj new file mode 100644 index 0000000..47a89a9 --- /dev/null +++ b/AIStudio.Wpf.JsonModel/AIStudio.Wpf.JsonModel.csproj @@ -0,0 +1,14 @@ + + + + AIStudio.Wpf.Controls + akwkevin + https://gitee.com/akwkevin + A.png + + + 1.0.7 + 一个Wpf的流程图控件Json对象 + + + diff --git a/AIStudio.Wpf.Mind/Controls/MindEditor.cs b/AIStudio.Wpf.Mind/Controls/MindEditor.cs new file mode 100644 index 0000000..560fb55 --- /dev/null +++ b/AIStudio.Wpf.Mind/Controls/MindEditor.cs @@ -0,0 +1,187 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows; +using System.Xml.Linq; +using AIStudio.Wpf.DiagramDesigner; +using AIStudio.Wpf.DiagramDesigner.Geometrys; + +namespace AIStudio.Wpf.Mind.Controls +{ + /// + /// MindEditor.xaml 的交互逻辑 + /// + [TemplatePart(Name = PART_DiagramControl, Type = typeof(DiagramControl))] + public partial class MindEditor : UserControl + { + public const string PART_DiagramControl = "PART_DiagramControl"; + private DiagramControl _diagramControl; + + private IDiagramViewModel _diagramViewModel; + + static MindEditor() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(MindEditor), new FrameworkPropertyMetadata(typeof(MindEditor))); + } + + public MindEditor() + { + _diagramViewModel = new DiagramViewModel(); + _diagramViewModel.ShowGrid = true; + _diagramViewModel.GridCellSize = new SizeBase(125 / ScreenHelper.ScreenScale, 125 / ScreenHelper.ScreenScale); + _diagramViewModel.GridMarginSize = new Size(0, 0); + _diagramViewModel.CellHorizontalAlignment = CellHorizontalAlignment.Center; + _diagramViewModel.CellVerticalAlignment = CellVerticalAlignment.Center; + _diagramViewModel.PageSizeType = PageSizeType.Custom; + _diagramViewModel.PageSize = new SizeBase(double.NaN, double.NaN); + _diagramViewModel.ColorViewModel = new ColorViewModel() { LineWidth = 2 }; + _diagramViewModel.DrawModeViewModel = new DrawModeViewModel() { LineDrawMode = DrawMode.ConnectingLineSmooth }; + + _diagramViewModel.PropertyChanged += DiagramViewModel_PropertyChanged; + } + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + _diagramControl = GetTemplateChild(PART_DiagramControl) as DiagramControl; + _diagramControl.HorizontalAlignment = HorizontalAlignment.Stretch; + _diagramControl.VerticalAlignment = VerticalAlignment.Stretch; + _diagramControl.DataContext = _diagramViewModel; + + GetDataFunc = GetData; + } + + private void DiagramViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e) + { + if (e.PropertyName == "IsSelected") + { + SelectedObject = _diagramViewModel.SelectedItems?.FirstOrDefault(); + } + } + + //一点要绑定不为空的FlowchartModel才能用,即便为空的也要new一个再来绑定 + public static readonly DependencyProperty DataProperty = + DependencyProperty.Register(nameof(Data), + typeof(string), + typeof(MindEditor), + new FrameworkPropertyMetadata(null, OnDataChanged)); + + public string Data + { + get + { + return (string)GetValue(DataProperty); + } + set + { + SetValue(DataProperty, value); + } + } + private static void OnDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var view = d as MindEditor; + var json = e.NewValue as string; + if (json != null) + { + view.CreateFlowchartModel(json); + } + } + + private void CreateFlowchartModel(string json) + { + _diagramViewModel.IsLoading = true; + _diagramViewModel.Items.Clear(); + //_diagramViewModel.ToObject(json); + _diagramViewModel.IsLoading = false; + } + + public static readonly DependencyProperty GetDataFuncProperty = + DependencyProperty.Register(nameof(GetDataFunc), + typeof(Func), + typeof(MindEditor), + new FrameworkPropertyMetadata(null)); + public Func GetDataFunc + { + get + { + return (Func)this.GetValue(GetDataFuncProperty); + } + set + { + this.SetValue(GetDataFuncProperty, value); + } + } + + public Func GetData + { + get + { + return new Func(() => _diagramViewModel.ToJson()); + } + } + + + public static readonly DependencyProperty ModeProperty = + DependencyProperty.Register(nameof(Mode), + typeof(string), + typeof(MindEditor), + new FrameworkPropertyMetadata("Edit", OnModeChanged)); + + public string Mode + { + get + { + return (string)GetValue(ModeProperty); + } + set + { + SetValue(ModeProperty, value); + } + } + + private static void OnModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var view = d as MindEditor; + var mode = e.NewValue as string; + if (mode != "Edit") + { + view._diagramViewModel.IsReadOnly = true; + } + else + { + view._diagramViewModel.IsReadOnly = false; + } + } + + #region SelectedObject + + public static readonly DependencyProperty SelectedObjectProperty = DependencyProperty.Register(nameof(SelectedObject), typeof(object), typeof(MindEditor), new UIPropertyMetadata(default(object))); + public object SelectedObject + { + get + { + return (object)GetValue(SelectedObjectProperty); + } + set + { + SetValue(SelectedObjectProperty, value); + } + } + + #endregion + + protected override void OnPreviewKeyDown(KeyEventArgs e) + { + base.OnPreviewKeyDown(e); + + e.Handled = _diagramViewModel.ExecuteShortcut(e); + } + + } +} diff --git a/AIStudio.Wpf.Mind/Helpers/DirectoryLayout.cs b/AIStudio.Wpf.Mind/Helpers/DirectoryLayout.cs index 1f2a89a..3edc81d 100644 --- a/AIStudio.Wpf.Mind/Helpers/DirectoryLayout.cs +++ b/AIStudio.Wpf.Mind/Helpers/DirectoryLayout.cs @@ -54,7 +54,6 @@ namespace AIStudio.Wpf.Mind.Helpers break; } case NodeLevel.Level3: - case NodeLevel.Level4: { mindNode.ItemWidth = 80; mindNode.ItemHeight = 25; diff --git a/AIStudio.Wpf.Mind/Helpers/FishBoneLayout.cs b/AIStudio.Wpf.Mind/Helpers/FishBoneLayout.cs index d886776..3055bef 100644 --- a/AIStudio.Wpf.Mind/Helpers/FishBoneLayout.cs +++ b/AIStudio.Wpf.Mind/Helpers/FishBoneLayout.cs @@ -70,27 +70,11 @@ namespace AIStudio.Wpf.Mind.Helpers mindNode.AddConnector(port1); var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 }; mindNode.AddConnector(port2); + var port3 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.25, YRatio = 0 }; + mindNode.AddConnector(port3); mindNode.IsInnerConnector = true; - mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf); - mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None; - mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall; - mindNode.CornerRadius = new System.Windows.CornerRadius(0); - mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0); - break; - } - case NodeLevel.Level4: - { - mindNode.ItemWidth = 80; - mindNode.ItemHeight = 25; - mindNode.ClearConnectors(); - - var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 }; - mindNode.AddConnector(port1); - var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 }; - mindNode.AddConnector(port2); - - mindNode.IsInnerConnector = true; + mindNode.ColorViewModel.FillColor.Color = Colors.Transparent; mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf); mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None; mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall; @@ -105,13 +89,23 @@ namespace AIStudio.Wpf.Mind.Helpers public ConnectionViewModel GetConnectionViewModel(MindNode source, MindNode sink) { - DrawMode drawMode = DrawMode.ConnectingLineStraight; - RouterMode routerMode = RouterMode.RouterNormal; + DrawMode drawMode; + RouterMode routerMode; if (source.NodeLevel == NodeLevel.Level1) { drawMode = DrawMode.ConnectingLineStraight; routerMode = RouterMode.RouterFishBone; } + else if (source.NodeLevel == NodeLevel.Level2) + { + drawMode = DrawMode.ConnectingLineStraight; + routerMode = RouterMode.RouterNormal; + } + else + { + drawMode = DrawMode.ConnectingLineStraight; + routerMode = RouterMode.RouterOrthogonal; + } var connector = new ConnectionViewModel(source.Root, source.Connectors.FirstOrDefault(), sink.Connectors.FirstOrDefault(), drawMode, routerMode); connector.ColorViewModel.LineColor = source.ColorViewModel.LineColor; @@ -139,6 +133,7 @@ namespace AIStudio.Wpf.Mind.Helpers public SizeBase MeasureOverride(MindNode mindNode, bool isExpanded = true) { var sizewithSpacing = mindNode.SizeWithSpacing; + var bottomoffset = mindNode.Spacing.Width / 2; if (mindNode.Children?.Count > 0) { if (mindNode.NodeLevel == NodeLevel.Level1) @@ -149,15 +144,15 @@ namespace AIStudio.Wpf.Mind.Helpers var bottoms = mindNode.Children.Where((p, index) => index % 2 == 1).ToList(); bottoms.ForEach(p => p.ConnectorOrientation = ConnectorOrientation.TopLeft); var bottomsizes = bottoms.Select(p => MeasureOverride(p, mindNode.IsExpanded && isExpanded)).ToArray(); - sizewithSpacing = new SizeBase(sizewithSpacing.Width + Math.Max(topsizes.Sum(p => p.Width), bottomsizes.Sum(p => p.Width)), sizewithSpacing.Height + topsizes.Max(p => p.Height) + bottomsizes.Max(p => p.Height)); + sizewithSpacing = new SizeBase(sizewithSpacing.Width + bottomoffset + Math.Max(topsizes.Sum(p => p.Width), bottomsizes.Sum(p => p.Width)), sizewithSpacing.Height + topsizes.Max(p => p.Height) + bottomsizes.Max(p => p.Height)); } else if (mindNode.NodeLevel == NodeLevel.Level2) { var childrensizes = mindNode.Children.Select(p => MeasureOverride(p, mindNode.IsExpanded && isExpanded)).ToArray(); var lastchildsize = childrensizes.LastOrDefault(); - sizewithSpacing = new SizeBase(sizewithSpacing.Height + childrensizes.Sum(p => p.Height) - lastchildsize.Height / 2 + lastchildsize.Width, sizewithSpacing.Height + childrensizes.Sum(p => p.Height)); + sizewithSpacing = new SizeBase(Math.Max(sizewithSpacing.Width, sizewithSpacing.Height + childrensizes.Sum(p => p.Height) - lastchildsize.Height / 2 + lastchildsize.Width), sizewithSpacing.Height + childrensizes.Sum(p => p.Height)); } - else if (mindNode.NodeLevel == NodeLevel.Level3 || mindNode.NodeLevel == NodeLevel.Level4) + else if (mindNode.NodeLevel == NodeLevel.Level3) { var childrensizes = mindNode.Children.Select(p => MeasureOverride(p, mindNode.IsExpanded && isExpanded)).ToArray(); sizewithSpacing = new SizeBase(Math.Max(sizewithSpacing.Width, sizewithSpacing.Width * 0.5 + childrensizes.Max(p => p.Width)), sizewithSpacing.Height + childrensizes.Sum(p => p.Height)); @@ -195,8 +190,9 @@ namespace AIStudio.Wpf.Mind.Helpers } } + var bottomoffset = mindNode.Spacing.Width / 2; var bottoms = mindNode.Children.Where(p => p.ConnectorOrientation == ConnectorOrientation.TopLeft).ToList(); - double bottomleft = mindNode.MiddlePosition.X + mindNode.ItemWidth / 2 + mindNode.Spacing.Width; + double bottomleft = mindNode.MiddlePosition.X + mindNode.ItemWidth / 2 + mindNode.Spacing.Width + bottomoffset; double bottomtop = mindNode.MiddlePosition.Y + mindNode.ItemHeight / 2 + mindNode.Spacing.Height; if (mindNode.Children?.Count > 0) @@ -266,25 +262,50 @@ namespace AIStudio.Wpf.Mind.Helpers } } } - else if (mindNode.NodeLevel == NodeLevel.Level3 || mindNode.NodeLevel == NodeLevel.Level4) + else if (mindNode.NodeLevel == NodeLevel.Level3) { - double left = mindNode.MiddlePosition.X; - double top = mindNode.MiddlePosition.Y + mindNode.ItemHeight / 2 + mindNode.Spacing.Height; - if (mindNode.Children?.Count > 0) + if (mindNode.GetLevel2Node().ConnectorOrientation == ConnectorOrientation.BottomLeft) { - foreach (var child in mindNode.Children) + double left = mindNode.MiddlePosition.X; + double top = mindNode.MiddlePosition.Y + mindNode.ItemHeight / 2 + mindNode.Spacing.Height; + if (mindNode.Children?.Count > 0) { - child.Left = left + child.Offset.X; - child.Top = top + child.Spacing.Height + child.Offset.Y; - child.DesiredPosition = child.Position; - top += child.DesiredSize.Height; + foreach (var child in mindNode.Children) + { + child.Left = left + child.Offset.X; + child.Top = top + child.Spacing.Height + child.Offset.Y; + child.DesiredPosition = child.Position; + top += child.DesiredSize.Height; - ArrangeOverride(child); + ArrangeOverride(child); - var connect = mindNode.Root?.Items.OfType().FirstOrDefault(p => p.SourceConnectorInfo?.DataItem == mindNode && p.SinkConnectorInfoFully?.DataItem == child); - connect?.SetSourcePort(mindNode.BottomConnector); - connect?.SetSinkPort(child.LeftConnector); - connect?.SetVisible(child.Visible); + var connect = mindNode.Root?.Items.OfType().FirstOrDefault(p => p.SourceConnectorInfo?.DataItem == mindNode && p.SinkConnectorInfoFully?.DataItem == child); + connect?.SetSourcePort(mindNode.BottomConnector); + connect?.SetSinkPort(child.LeftConnector); + connect?.SetVisible(child.Visible); + } + } + } + else + { + double left = mindNode.MiddlePosition.X; + double bottom = mindNode.MiddlePosition.Y - mindNode.ItemHeight / 2 - mindNode.Spacing.Height; + if (mindNode.Children?.Count > 0) + { + foreach (var child in mindNode.Children) + { + child.Left = left + child.Offset.X; + child.Top = bottom - child.Spacing.Height - child.ItemHeight + child.Offset.Y; + child.DesiredPosition = child.Position; + bottom -= child.DesiredSize.Height; + + ArrangeOverride(child); + + var connect = mindNode.Root?.Items.OfType().FirstOrDefault(p => p.SourceConnectorInfo?.DataItem == mindNode && p.SinkConnectorInfoFully?.DataItem == child); + connect?.SetSourcePort(mindNode.TopConnector); + connect?.SetSinkPort(child.LeftConnector); + connect?.SetVisible(child.Visible); + } } } } diff --git a/AIStudio.Wpf.Mind/Helpers/MindLayout.cs b/AIStudio.Wpf.Mind/Helpers/MindLayout.cs index 8097374..d837713 100644 --- a/AIStudio.Wpf.Mind/Helpers/MindLayout.cs +++ b/AIStudio.Wpf.Mind/Helpers/MindLayout.cs @@ -55,7 +55,6 @@ namespace AIStudio.Wpf.Mind.Helpers break; } case NodeLevel.Level3: - case NodeLevel.Level4: { mindNode.ItemWidth = 80; mindNode.ItemHeight = 25; diff --git a/AIStudio.Wpf.Mind/Helpers/OrganizationalLayout.cs b/AIStudio.Wpf.Mind/Helpers/OrganizationalLayout.cs index 9d2378a..721a39d 100644 --- a/AIStudio.Wpf.Mind/Helpers/OrganizationalLayout.cs +++ b/AIStudio.Wpf.Mind/Helpers/OrganizationalLayout.cs @@ -54,7 +54,6 @@ namespace AIStudio.Wpf.Mind.Helpers break; } case NodeLevel.Level3: - case NodeLevel.Level4: { mindNode.ItemWidth = 80; mindNode.ItemHeight = 25; diff --git a/AIStudio.Wpf.Mind/NodeLevel.cs b/AIStudio.Wpf.Mind/NodeLevel.cs index b2eebf6..af1fd22 100644 --- a/AIStudio.Wpf.Mind/NodeLevel.cs +++ b/AIStudio.Wpf.Mind/NodeLevel.cs @@ -8,7 +8,6 @@ namespace AIStudio.Wpf.Mind { Level1, Level2, - Level3, - Level4 + Level3 } } diff --git a/AIStudio.Wpf.Mind/Themes/MindNode.xaml b/AIStudio.Wpf.Mind/Themes/MindNode.xaml index baa6ac2..a347efb 100644 --- a/AIStudio.Wpf.Mind/Themes/MindNode.xaml +++ b/AIStudio.Wpf.Mind/Themes/MindNode.xaml @@ -154,9 +154,6 @@ - - - diff --git a/AIStudio.Wpf.Mind/ViewModels/MindNode.cs b/AIStudio.Wpf.Mind/ViewModels/MindNode.cs index a5e2e57..bdffda8 100644 --- a/AIStudio.Wpf.Mind/ViewModels/MindNode.cs +++ b/AIStudio.Wpf.Mind/ViewModels/MindNode.cs @@ -356,7 +356,7 @@ namespace AIStudio.Wpf.Mind.ViewModels } else { - node = new MindNode(Root, (NodeLevel)Math.Min((int)NodeLevel + 1, (int)NodeLevel.Level4), this.MindType) { Text = "分支主题" }; + node = new MindNode(Root, (NodeLevel)Math.Min((int)NodeLevel + 1, (int)NodeLevel.Level3), this.MindType) { Text = "分支主题" }; } AddChild(node);