diff --git a/AIStudio.Wpf.DiagramApp/AIStudio.Wpf.DiagramApp.csproj b/AIStudio.Wpf.DiagramApp/AIStudio.Wpf.DiagramApp.csproj index e3a48d0..99396ed 100644 --- a/AIStudio.Wpf.DiagramApp/AIStudio.Wpf.DiagramApp.csproj +++ b/AIStudio.Wpf.DiagramApp/AIStudio.Wpf.DiagramApp.csproj @@ -109,6 +109,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/AIStudio.Wpf.DiagramApp/App.xaml b/AIStudio.Wpf.DiagramApp/App.xaml index 8f026e9..1006b6c 100644 --- a/AIStudio.Wpf.DiagramApp/App.xaml +++ b/AIStudio.Wpf.DiagramApp/App.xaml @@ -13,6 +13,7 @@ + diff --git a/AIStudio.Wpf.DiagramApp/FodyWeavers.xml b/AIStudio.Wpf.DiagramApp/FodyWeavers.xml new file mode 100644 index 0000000..5029e70 --- /dev/null +++ b/AIStudio.Wpf.DiagramApp/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/AIStudio.Wpf.DiagramApp/FodyWeavers.xsd b/AIStudio.Wpf.DiagramApp/FodyWeavers.xsd new file mode 100644 index 0000000..05e92c1 --- /dev/null +++ b/AIStudio.Wpf.DiagramApp/FodyWeavers.xsd @@ -0,0 +1,141 @@ + + + + + + + + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with line breaks. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with line breaks. + + + + + The order of preloaded assemblies, delimited with line breaks. + + + + + + This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. + + + + + Controls if .pdbs for reference assemblies are also embedded. + + + + + Controls if runtime assemblies are also embedded. + + + + + Controls whether the runtime assemblies are embedded with their full path or only with their assembly name. + + + + + Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. + + + + + As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. + + + + + Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with |. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with |. + + + + + The order of preloaded assemblies, delimited with |. + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs index 019f41a..51ddd40 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs @@ -57,7 +57,6 @@ namespace AIStudio.Wpf.Flowchart InitDiagramViewModel(); var level1node = MindDiagramViewModel.RootItem; - DiagramViewModel.CenterMoveCommand.Execute(level1node); MindNode level2node1_1 = new MindNode(DiagramViewModel) { Text = "分支主题1" }; MindDiagramViewModel.AddChildCommand.Execute(new MindNode[] { level1node, level2node1_1 }); @@ -83,7 +82,10 @@ namespace AIStudio.Wpf.Flowchart protected override DiagramViewModel GetDiagramViewModel(string name, DiagramType diagramType) { - return new MindDiagramViewModel() { Name = name ?? NewNameHelper.GetNewName(DiagramViewModels.Select(p => p.Name), "页-"), DiagramType = diagramType }; + var viewmodel = new MindDiagramViewModel() { Name = name ?? NewNameHelper.GetNewName(DiagramViewModels.Select(p => p.Name), "页-"), DiagramType = diagramType }; + viewmodel.Init(); + + return viewmodel; } public override void Dispose() diff --git a/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml b/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml index 515bc96..1d19195 100644 --- a/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml +++ b/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml @@ -18,7 +18,6 @@ xmlns:drop="urn:gong-wpf-dragdrop" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Converters;assembly=AIStudio.Wpf.DiagramDesigner.Additionals" - xmlns:mimd="clr-namespace:AIStudio.Wpf.Mind;assembly=AIStudio.Wpf.Mind" xmlns:viewmodel="clr-namespace:AIStudio.Wpf.DiagramApp.ViewModels" Style="{StaticResource RibbonWindowStyle}" Icon="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Icons/App.ico" @@ -32,6 +31,7 @@ + @@ -1326,12 +1326,7 @@ Text="快速样式" Width="190" /> - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AIStudio.Wpf.Mind/Helpers/DirectoryLayout.cs b/AIStudio.Wpf.Mind/Helpers/DirectoryLayout.cs index 845d925..b81b6ca 100644 --- a/AIStudio.Wpf.Mind/Helpers/DirectoryLayout.cs +++ b/AIStudio.Wpf.Mind/Helpers/DirectoryLayout.cs @@ -86,14 +86,13 @@ namespace AIStudio.Wpf.Mind.Helpers } else { - connector?.SetSourcePort(source.FirstConnector); - connector?.SetSinkPort(sink.FirstConnector); - connector.PathMode = DrawMode.ConnectingLineStraight.ToString(); - connector.RouterMode = RouterMode.RouterOrthogonal.ToString(); + connector?.UpdateConnectionMode(source.FirstConnector, sink.FirstConnector, DrawMode.ConnectingLineStraight.ToString(), RouterMode.RouterOrthogonal.ToString()); } connector.ColorViewModel.LineColor = source.ColorViewModel.LineColor; connector.SmoothMargin = 20; connector.SmoothAutoSlope = 0.2; + connector.OrthogonalShapeMargin = 2; + connector.OrthogonalGlobalBoundsMargin = 5; connector.ShapeViewModel.SinkMarker.PathStyle = source.ShapeViewModel.SinkMarker.PathStyle; connector.ShapeViewModel.SinkMarker.SizeStyle = source.ShapeViewModel.SinkMarker.SizeStyle; diff --git a/AIStudio.Wpf.Mind/Helpers/FishBoneLayout.cs b/AIStudio.Wpf.Mind/Helpers/FishBoneLayout.cs index 258c93e..7cc2226 100644 --- a/AIStudio.Wpf.Mind/Helpers/FishBoneLayout.cs +++ b/AIStudio.Wpf.Mind/Helpers/FishBoneLayout.cs @@ -112,14 +112,13 @@ namespace AIStudio.Wpf.Mind.Helpers } else { - connector?.SetSourcePort(source.FirstConnector); - connector?.SetSinkPort(sink.FirstConnector); - connector.PathMode = drawMode.ToString(); - connector.RouterMode = routerMode.ToString(); + connector?.UpdateConnectionMode(source.FirstConnector, sink.FirstConnector, drawMode.ToString(), routerMode.ToString()); } connector.ColorViewModel.LineColor = source.ColorViewModel.LineColor; connector.SmoothMargin = 20; connector.SmoothAutoSlope = 0.2; + connector.OrthogonalShapeMargin = 2; + connector.OrthogonalGlobalBoundsMargin = 5; connector.ShapeViewModel.SinkMarker.PathStyle = source.ShapeViewModel.SinkMarker.PathStyle; connector.ShapeViewModel.SinkMarker.SizeStyle = source.ShapeViewModel.SinkMarker.SizeStyle; diff --git a/AIStudio.Wpf.Mind/Helpers/LogicalLayout.cs b/AIStudio.Wpf.Mind/Helpers/LogicalLayout.cs index dcc3c36..3ed77e4 100644 --- a/AIStudio.Wpf.Mind/Helpers/LogicalLayout.cs +++ b/AIStudio.Wpf.Mind/Helpers/LogicalLayout.cs @@ -84,14 +84,13 @@ namespace AIStudio.Wpf.Mind.Helpers } else { - connector?.SetSourcePort(source.FirstConnector); - connector?.SetSinkPort(sink.FirstConnector); - connector.PathMode = DrawMode.ConnectingLineSmooth.ToString(); - connector.RouterMode = RouterMode.RouterNormal.ToString(); + connector?.UpdateConnectionMode(source.FirstConnector, sink.FirstConnector, DrawMode.ConnectingLineSmooth.ToString(), RouterMode.RouterNormal.ToString()); } connector.ColorViewModel.LineColor = source.ColorViewModel.LineColor; connector.SmoothMargin = 20; connector.SmoothAutoSlope = 0.2; + connector.OrthogonalShapeMargin = 2; + connector.OrthogonalGlobalBoundsMargin = 5; connector.ShapeViewModel.SinkMarker.PathStyle = source.ShapeViewModel.SinkMarker.PathStyle; connector.ShapeViewModel.SinkMarker.SizeStyle = source.ShapeViewModel.SinkMarker.SizeStyle; diff --git a/AIStudio.Wpf.Mind/Helpers/MindLayout.cs b/AIStudio.Wpf.Mind/Helpers/MindLayout.cs index aa1938b..613aaee 100644 --- a/AIStudio.Wpf.Mind/Helpers/MindLayout.cs +++ b/AIStudio.Wpf.Mind/Helpers/MindLayout.cs @@ -85,14 +85,14 @@ namespace AIStudio.Wpf.Mind.Helpers } else { - connector?.SetSourcePort(source.FirstConnector); - connector?.SetSinkPort(sink.FirstConnector); - connector.PathMode = DrawMode.ConnectingLineSmooth.ToString(); - connector.RouterMode = RouterMode.RouterNormal.ToString(); + connector?.UpdateConnectionMode(source.FirstConnector, sink.FirstConnector, DrawMode.ConnectingLineSmooth.ToString(), RouterMode.RouterNormal.ToString()); } + connector.ColorViewModel.LineColor = source.ColorViewModel.LineColor; connector.SmoothMargin = 20; connector.SmoothAutoSlope = 0.2; + connector.OrthogonalShapeMargin = 2; + connector.OrthogonalGlobalBoundsMargin = 5; connector.ShapeViewModel.SinkMarker.PathStyle = source.ShapeViewModel.SinkMarker.PathStyle; connector.ShapeViewModel.SinkMarker.SizeStyle = source.ShapeViewModel.SinkMarker.SizeStyle; diff --git a/AIStudio.Wpf.Mind/Helpers/MindThemeHelper.cs b/AIStudio.Wpf.Mind/Helpers/MindThemeHelper.cs index 9ded7ea..7fa924c 100644 --- a/AIStudio.Wpf.Mind/Helpers/MindThemeHelper.cs +++ b/AIStudio.Wpf.Mind/Helpers/MindThemeHelper.cs @@ -44,6 +44,7 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0x73, 0xa1, 0xbf), + LineColor = Color.FromRgb(0x73, 0xa1, 0xbf), FontColor = Colors.White, FontSize = 15, Spacing = new SizeBase(50, 15), @@ -52,8 +53,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x73, 0xa1, 0xbf), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xee, 0xf3, 0xf6), + LineColor = Color.FromRgb(0x73, 0xa1, 0xbf), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), }, @@ -61,8 +63,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x73, 0xa1, 0xbf), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0x73, 0xa1, 0xbf), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), } @@ -78,27 +81,30 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0x73, 0xa1, 0xbf), + LineColor = Color.FromRgb(0x73, 0xa1, 0xbf), FontColor = Colors.White, FontSize = 15, - Spacing = new SizeBase(50, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel2 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x73, 0xa1, 0xbf), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xee, 0xf3, 0xf6), + LineColor = Color.FromRgb(0x73, 0xa1, 0xbf), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel3 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x73, 0xa1, 0xbf), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0x73, 0xa1, 0xbf), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), } }; } @@ -112,6 +118,7 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0x73, 0xbf, 0x76), + LineColor = Color.FromRgb(0x73, 0xbf, 0x76), FontColor = Colors.White, FontSize = 15, Spacing = new SizeBase(50, 15), @@ -120,8 +127,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x73, 0xbf, 0x76), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xee, 0xf6, 0xee), + LineColor = Color.FromRgb(0x73, 0xbf, 0x76), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), }, @@ -129,8 +137,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x73, 0xbf, 0x76), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0x73, 0xbf, 0x76), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), } @@ -146,27 +155,30 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0x73, 0xbf, 0x76), + LineColor = Color.FromRgb(0x73, 0xbf, 0x76), FontColor = Colors.White, FontSize = 15, - Spacing = new SizeBase(50, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel2 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x73, 0xbf, 0x76), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xee, 0xf6, 0xee), + LineColor = Color.FromRgb(0x73, 0xbf, 0x76), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel3 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x73, 0xbf, 0x76), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0x73, 0xbf, 0x76), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), } }; } @@ -180,6 +192,7 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0xbf, 0x73, 0x94), + LineColor = Color.FromRgb(0xbf, 0x73, 0x94), FontColor = Colors.White, FontSize = 15, Spacing = new SizeBase(50, 15), @@ -188,8 +201,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x73, 0x94), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xf6, 0xee, 0xf2), + LineColor = Color.FromRgb(0xbf, 0x73, 0x94), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), }, @@ -197,8 +211,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x73, 0x94), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0xbf, 0x73, 0x94), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), } @@ -214,27 +229,30 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0xbf, 0x73, 0x94), + LineColor = Color.FromRgb(0xbf, 0x73, 0x94), FontColor = Colors.White, FontSize = 15, - Spacing = new SizeBase(50, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel2 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x73, 0x94), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xf6, 0xee, 0xf2), + LineColor = Color.FromRgb(0xbf, 0x73, 0x94), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel3 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x73, 0x94), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0xbf, 0x73, 0x94), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), } }; } @@ -248,6 +266,7 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0x7b, 0x73, 0xbf), + LineColor = Color.FromRgb(0x7b, 0x73, 0xbf), FontColor = Colors.White, FontSize = 15, Spacing = new SizeBase(50, 15), @@ -256,8 +275,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x7b, 0x73, 0xbf), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xef, 0xee, 0xf6), + LineColor = Color.FromRgb(0x7b, 0x73, 0xbf), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), }, @@ -265,8 +285,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x7b, 0x73, 0xbf), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0x7b, 0x73, 0xbf), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), } @@ -282,27 +303,30 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0x7b, 0x73, 0xbf), + LineColor = Color.FromRgb(0x7b, 0x73, 0xbf), FontColor = Colors.White, FontSize = 15, - Spacing = new SizeBase(50, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel2 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x7b, 0x73, 0xbf), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xef, 0xee, 0xf6), + LineColor = Color.FromRgb(0x7b, 0x73, 0xbf), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel3 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0x7b, 0x73, 0xbf), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0x7b, 0x73, 0xbf), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), } }; } @@ -316,6 +340,7 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0xbf, 0x73, 0x73), + LineColor = Color.FromRgb(0xbf, 0x73, 0x73), FontColor = Colors.White, FontSize = 15, Spacing = new SizeBase(50, 15), @@ -324,8 +349,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x73, 0x73), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xf6, 0xee, 0xee), + LineColor = Color.FromRgb(0xbf, 0x73, 0x73), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), }, @@ -333,8 +359,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x73, 0x73), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0xbf, 0x73, 0x73), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), } @@ -350,27 +377,30 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0xbf, 0x73, 0x73), + LineColor = Color.FromRgb(0xbf, 0x73, 0x73), FontColor = Colors.White, FontSize = 15, - Spacing = new SizeBase(50, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel2 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x73, 0x73), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xf6, 0xee, 0xee), + LineColor = Color.FromRgb(0xbf, 0x73, 0x73), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel3 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x73, 0x73), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0xbf, 0x73, 0x73), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), } }; } @@ -384,6 +414,7 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0xbf, 0x93, 0x73), + LineColor = Color.FromRgb(0xbf, 0x93, 0x73), FontColor = Colors.White, FontSize = 15, Spacing = new SizeBase(50, 15), @@ -392,8 +423,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x93, 0x73), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xf6, 0xf2, 0xee), + LineColor = Color.FromRgb(0xbf, 0x93, 0x73), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), }, @@ -401,8 +433,9 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x93, 0x73), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0xbf, 0x93, 0x73), + FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), } @@ -418,27 +451,30 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0xbf, 0x93, 0x73), + LineColor = Color.FromRgb(0xbf, 0x93, 0x73), FontColor = Colors.White, FontSize = 15, - Spacing = new SizeBase(50, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel2 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x93, 0x73), - FontColor = Colors.White, + FillColor = Color.FromRgb(0xf6, 0xf2, 0xee), + LineColor = Color.FromRgb(0xbf, 0x93, 0x73), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel3 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xbf, 0x93, 0x73), - FontColor = Colors.White, + FillColor = Colors.Transparent, + LineColor = Color.FromRgb(0xbf, 0x93, 0x73), + FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), } }; } @@ -452,6 +488,7 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0xe9, 0xdf, 0x98), + LineColor = Color.FromRgb(0xe9, 0xdf, 0x98), FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(50, 15), @@ -460,7 +497,8 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xe9, 0xdf, 0x98), + FillColor = Color.FromRgb(0xa4, 0xc5, 0xc0), + LineColor = Color.FromRgb(0xa4, 0xc5, 0xc0), FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), @@ -469,7 +507,8 @@ namespace AIStudio.Wpf.Mind.Helpers { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xe9, 0xdf, 0x98), + FillColor = Colors.White, + LineColor = Colors.White, FontColor = Colors.Black, FontSize = 15, Spacing = new SizeBase(15, 15), @@ -486,27 +525,30 @@ namespace AIStudio.Wpf.Mind.Helpers ItemWidth = 110, ItemHeight = 40, FillColor = Color.FromRgb(0xe9, 0xdf, 0x98), + LineColor = Color.FromRgb(0xe9, 0xdf, 0x98), FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(50, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel2 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xe9, 0xdf, 0x98), + FillColor = Color.FromRgb(0xa4, 0xc5, 0xc0), + LineColor = Color.FromRgb(0xa4, 0xc5, 0xc0), FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), }, MindThemeLevel3 = new MindTheme() { ItemWidth = 80, ItemHeight = 25, - FillColor = Color.FromRgb(0xe9, 0xdf, 0x98), + FillColor = Colors.White, + LineColor = Colors.White, FontColor = Colors.Black, FontSize = 15, - Spacing = new SizeBase(15, 15), + Spacing = new SizeBase(10, 10), } }; } @@ -520,7 +562,7 @@ namespace AIStudio.Wpf.Mind.Helpers mindNode.ItemWidth = mindThemeModel.MindThemeLevel1.ItemWidth; mindNode.ItemHeight = mindThemeModel.MindThemeLevel1.ItemHeight; mindNode.ColorViewModel.FillColor.Color = mindThemeModel.MindThemeLevel1.FillColor; - mindNode.ColorViewModel.LineColor.Color = mindThemeModel.MindThemeLevel1.FillColor; + mindNode.ColorViewModel.LineColor.Color = mindThemeModel.MindThemeLevel1.LineColor; mindNode.FontViewModel.FontColor = mindThemeModel.MindThemeLevel1.FontColor; mindNode.FontViewModel.FontSize = mindThemeModel.MindThemeLevel1.FontSize; mindNode.Spacing = mindThemeModel.MindThemeLevel1.Spacing; @@ -531,7 +573,7 @@ namespace AIStudio.Wpf.Mind.Helpers mindNode.ItemWidth = mindThemeModel.MindThemeLevel2.ItemWidth; mindNode.ItemHeight = mindThemeModel.MindThemeLevel2.ItemHeight; mindNode.ColorViewModel.FillColor.Color = mindThemeModel.MindThemeLevel2.FillColor; - mindNode.ColorViewModel.LineColor.Color = mindThemeModel.MindThemeLevel2.FillColor; + mindNode.ColorViewModel.LineColor.Color = mindThemeModel.MindThemeLevel2.LineColor; mindNode.FontViewModel.FontColor = mindThemeModel.MindThemeLevel2.FontColor; mindNode.FontViewModel.FontSize = mindThemeModel.MindThemeLevel2.FontSize; mindNode.Spacing = mindThemeModel.MindThemeLevel2.Spacing; @@ -542,7 +584,7 @@ namespace AIStudio.Wpf.Mind.Helpers mindNode.ItemWidth = mindThemeModel.MindThemeLevel3.ItemWidth; mindNode.ItemHeight = mindThemeModel.MindThemeLevel3.ItemHeight; mindNode.ColorViewModel.FillColor.Color = mindThemeModel.MindThemeLevel3.FillColor; - mindNode.ColorViewModel.LineColor.Color = mindThemeModel.MindThemeLevel3.FillColor; + mindNode.ColorViewModel.LineColor.Color = mindThemeModel.MindThemeLevel3.LineColor; mindNode.FontViewModel.FontColor = mindThemeModel.MindThemeLevel3.FontColor; mindNode.FontViewModel.FontSize = mindThemeModel.MindThemeLevel3.FontSize; mindNode.Spacing = mindThemeModel.MindThemeLevel3.Spacing; @@ -566,6 +608,10 @@ namespace AIStudio.Wpf.Mind.Helpers { get; set; } + public Color LineColor + { + get; set; + } public Color FontColor { get; set; diff --git a/AIStudio.Wpf.Mind/Helpers/OrganizationalLayout.cs b/AIStudio.Wpf.Mind/Helpers/OrganizationalLayout.cs index 5d048a0..da58b78 100644 --- a/AIStudio.Wpf.Mind/Helpers/OrganizationalLayout.cs +++ b/AIStudio.Wpf.Mind/Helpers/OrganizationalLayout.cs @@ -86,14 +86,13 @@ namespace AIStudio.Wpf.Mind.Helpers } else { - connector?.SetSourcePort(source.FirstConnector); - connector?.SetSinkPort(sink.FirstConnector); - connector.PathMode = DrawMode.ConnectingLineStraight.ToString(); - connector.RouterMode = RouterMode.RouterOrthogonal.ToString(); + connector?.UpdateConnectionMode(source.FirstConnector, sink.FirstConnector, DrawMode.ConnectingLineStraight.ToString(), RouterMode.RouterOrthogonal.ToString()); } connector.ColorViewModel.LineColor = source.ColorViewModel.LineColor; connector.SmoothMargin = 20; connector.SmoothAutoSlope = 0.2; + connector.OrthogonalShapeMargin = 2; + connector.OrthogonalGlobalBoundsMargin = 5; connector.ShapeViewModel.SinkMarker.PathStyle = source.ShapeViewModel.SinkMarker.PathStyle; connector.ShapeViewModel.SinkMarker.SizeStyle = sink.ShapeViewModel.SinkMarker.SizeStyle; diff --git a/AIStudio.Wpf.Mind/Styles/Button.xaml b/AIStudio.Wpf.Mind/Styles/Button.xaml index 5b7b6d3..abaeed6 100644 --- a/AIStudio.Wpf.Mind/Styles/Button.xaml +++ b/AIStudio.Wpf.Mind/Styles/Button.xaml @@ -9,7 +9,7 @@ - + diff --git a/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs b/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs index 5a3a4ac..2a2134f 100644 --- a/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs +++ b/AIStudio.Wpf.Mind/ViewModels/MindDiagramViewModel.cs @@ -45,6 +45,14 @@ namespace AIStudio.Wpf.Mind.ViewModels return Items.OfType().FirstOrDefault(); } } + + public MindNode MindSelectedItem + { + get + { + return SelectedItem as MindNode; + } + } #endregion #region 命令 @@ -280,7 +288,7 @@ namespace AIStudio.Wpf.Mind.ViewModels { return this._expand2LevelCommand ?? (this._expand2LevelCommand = new SimpleCommand(ExecuteEnable, this.ExecutedExpand2LevelCommand)); } - } + } #endregion public MindDiagramViewModel() @@ -294,7 +302,7 @@ namespace AIStudio.Wpf.Mind.ViewModels { InitRootItem(); } - GetChildren(RootItem); + ResetChildren(RootItem); RootItem?.LayoutUpdated(); base.Init(); } @@ -325,7 +333,7 @@ namespace AIStudio.Wpf.Mind.ViewModels return (SelectedItem as MindNode).NodeLevel != 0; } - #region 操作 + #region 添加删除 public void ExecuteAddChildCommand(object parameter) { List items = new List(); @@ -578,15 +586,9 @@ namespace AIStudio.Wpf.Mind.ViewModels else return false; } + #endregion - protected override void ExecuteCenterMoveCommand(object parameter) - { - RootItem.Left = (PageSize.Width - RootItem.ItemWidth) / 2; - RootItem.Top = (PageSize.Height - RootItem.ItemHeight) / 2; - RootItem?.LayoutUpdated(); - FitViewModel = new FitViewModel() { BoundingRect = RootItem.GetBounds() }; - } - + #region 附加信息 private void ExecuteAddLinkCommand(object obj) { if (obj is object[] array && array.Length == 2) @@ -687,7 +689,9 @@ namespace AIStudio.Wpf.Mind.ViewModels p.Tags.Remove(obj?.ToString()); }); } + #endregion + #region 改变模式,主题 private void ExecutedChangeMindTypeCommand(object obj) { if (obj is MindType mindType) @@ -748,7 +752,7 @@ namespace AIStudio.Wpf.Mind.ViewModels } } - private MindNode FormatNode; + private MindNode _formatNode; private void ExecutedCopyThemeCommand(object parameter) { if (parameter is MindNode node) @@ -762,13 +766,13 @@ namespace AIStudio.Wpf.Mind.ViewModels if (node != null) { - FormatNode = node; + _formatNode = node; } } private void ExecutedPasteThemeCommand(object parameter) { - if (FormatNode != null) + if (_formatNode != null) { List nodes = new List(); if (parameter is MindNode node1) @@ -790,8 +794,8 @@ namespace AIStudio.Wpf.Mind.ViewModels () => { foreach (var node in nodes) { - CopyHelper.CopyPropertyValue(FormatNode.ColorViewModel, node.ColorViewModel); - CopyHelper.CopyPropertyValue(FormatNode.FontViewModel, node.FontViewModel); + CopyHelper.CopyPropertyValue(_formatNode.ColorViewModel, node.ColorViewModel); + CopyHelper.CopyPropertyValue(_formatNode.FontViewModel, node.FontViewModel); } RootItem.LayoutUpdated(); }, @@ -803,6 +807,16 @@ namespace AIStudio.Wpf.Mind.ViewModels } } + #endregion + + #region 操作 + protected override void ExecuteCenterMoveCommand(object parameter) + { + RootItem.Left = (PageSize.Width - RootItem.ItemWidth) / 2; + RootItem.Top = (PageSize.Height - RootItem.ItemHeight) / 2; + RootItem?.LayoutUpdated(); + FitViewModel = new FitViewModel() { BoundingRect = RootItem.GetBounds() }; + } private void ExecutedExpand2LevelCommand(object obj) { @@ -823,8 +837,84 @@ namespace AIStudio.Wpf.Mind.ViewModels item.IsExpanded = false; } } - } + } + + protected void ExecuteSelectBrotherCommand(object parameter) + { + if (parameter is MindNode node) + { + + } + else + { + node = SelectedItem as MindNode; + } + + if (node != null && node.ParentNode != null) + { + foreach (var child in node.ParentNode.Children) + { + child.IsSelected = true; + } + } + } + + protected void ExecuteSelectPearCommand(object parameter) + { + if (parameter is MindNode node) + { + + } + else + { + node = SelectedItem as MindNode; + } + + if (node != null) + { + foreach (var item in Items.OfType().Where(p => p.NodeLevel == node.NodeLevel)) + { + item.IsSelected = true; + } + } + } + + protected void ExecuteSelectRouteCommand(object parameter) + { + if (parameter is MindNode node) + { + + } + else + { + node = SelectedItem as MindNode; + } + + if (node != null) + { + GetParent(node).ForEach(p => p.IsSelected = true); + } + } + + protected void ExecuteSelectChildCommand(object parameter) + { + if (parameter is MindNode node) + { + + } + else + { + node = SelectedItem as MindNode; + } + + if (node != null) + { + GetChildren(node).ForEach(p => p.IsSelected = true); + } + } #endregion + + #region 初始化 protected override void ExecutedResetLayoutCommand(object obj) { foreach (var item in Items.OfType()) @@ -834,7 +924,7 @@ namespace AIStudio.Wpf.Mind.ViewModels RootItem?.LayoutUpdated(); } - private void GetChildren(MindNode parent) + private void ResetChildren(MindNode parent) { if (parent == null) return; @@ -845,9 +935,34 @@ namespace AIStudio.Wpf.Mind.ViewModels item.Parent = parent; item.InitLayout(false); item.InitConnectLayout(); - GetChildren(item); + ResetChildren(item); } } + private List GetParent(MindNode node) + { + List mindnode = new List(); + while (node.ParentNode != null) + { + mindnode.Add(node.ParentNode); + node = node.ParentNode; + } + return mindnode; + } + + private List GetChildren(MindNode parent) + { + List mindnode = new List(); + if (parent.Children != null) + { + foreach (var child in parent.Children) + { + mindnode.Add(child); + mindnode.AddRange(GetChildren(child)); + } + } + return mindnode; + } + #endregion } } diff --git a/AIStudio.Wpf.Mind/ViewModels/MindNode.cs b/AIStudio.Wpf.Mind/ViewModels/MindNode.cs index 44681ed..7646853 100644 --- a/AIStudio.Wpf.Mind/ViewModels/MindNode.cs +++ b/AIStudio.Wpf.Mind/ViewModels/MindNode.cs @@ -77,7 +77,8 @@ namespace AIStudio.Wpf.Mind.ViewModels IsInnerConnector = true; MindLayout.Appearance(this, MindThemeModel, initAppearance); - + + var xx = GlobalType.AllTypes; this.PropertyChanged -= this.Item_PropertyChanged; this.PropertyChanged += this.Item_PropertyChanged; } diff --git a/Directory.Build.Props b/Directory.Build.Props index 4d652c4..b3d0e9d 100644 --- a/Directory.Build.Props +++ b/Directory.Build.Props @@ -1,7 +1,7 @@ - netcoreapp3.1;net5.0-windows + net461;netcoreapp3.1;net5.0-windows