mind基本完成,准备写文档

This commit is contained in:
艾竹
2023-03-19 23:26:14 +08:00
parent c2f4d3c706
commit 07ac28965e
28 changed files with 1363 additions and 211 deletions

View File

@@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
xmlns:controls="clr-namespace:AIStudio.Wpf.Mind.Controls"
@@ -21,9 +22,9 @@
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid Height="70">
<Grid Height="100">
<TabControl>
<TabItem Header="思路">
<TabItem Header="思路" Height="30" Width="50">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@@ -103,7 +104,7 @@
<TextBlock>编辑</TextBlock>
</StackPanel>
</Button>
<Button Style="{StaticResource FlatButtonStyle}" Command="{Binding DeleteCommand}" Height="22" VerticalAlignment="Bottom">
<Button Style="{StaticResource FlatButtonStyle}" Command="{Binding DeleteCommand}">
<StackPanel Orientation="Horizontal">
<Path Width="12" Height="12" Stretch="Uniform" Fill="Black" Data="M 25.3333,23.75L 50.6667,23.75C 51.5411,23.75 51.8541,27.3125 51.8541,27.3125L 24.1458,27.3125C 24.1458,27.3125 24.4589,23.75 25.3333,23.75 Z M 35.625,19.7917L 40.375,19.7917C 40.8122,19.7917 41.9583,20.9378 41.9583,21.375C 41.9583,21.8122 40.8122,22.9584 40.375,22.9584L 35.625,22.9584C 35.1878,22.9584 34.0416,21.8122 34.0416,21.375C 34.0416,20.9378 35.1878,19.7917 35.625,19.7917 Z M 27.7083,28.5L 48.2916,28.5C 49.1661,28.5 49.875,29.2089 49.875,30.0834L 48.2916,53.8334C 48.2916,54.7078 47.5828,55.4167 46.7083,55.4167L 29.2917,55.4167C 28.4172,55.4167 27.7083,54.7078 27.7083,53.8334L 26.125,30.0834C 26.125,29.2089 26.8339,28.5 27.7083,28.5 Z M 30.0833,31.6667L 30.4792,52.25L 33.25,52.25L 32.8542,31.6667L 30.0833,31.6667 Z M 36.4167,31.6667L 36.4167,52.25L 39.5833,52.25L 39.5833,31.6667L 36.4167,31.6667 Z M 43.1458,31.6667L 42.75,52.25L 45.5208,52.25L 45.9167,31.6667L 43.1458,31.6667 Z "></Path>
<TextBlock>删除</TextBlock>
@@ -309,69 +310,80 @@
<UniformGrid Columns="5" Grid.Row="0" Grid.Column="12" >
<Button Style="{StaticResource FlatCircleButtonStyle}"
Background="Yellow"
Margin="1"
Width="20"
Height="20"
Command="{Binding AddRatioCommand}"
CommandParameter="Null">
<Path Stretch="Uniform" Fill="DarkRed" Data="m 256,76 c 48.1,0 93.3,18.7 127.3,52.7 34,34 52.7,79.2 52.7,127.3 0,48.1 -18.7,93.3 -52.7,127.3 -34,34 -79.2,52.7 -127.3,52.7 -48.1,0 -93.3,-18.7 -127.3,-52.7 C 94.7,349.3 76,304.1 76,256 76,207.9 94.7,162.7 128.7,128.7 162.7,94.7 207.9,76 256,76 m 0,-28 C 141.1,48 48,141.1 48,256 48,370.9 141.1,464 256,464 370.9,464 464,370.9 464,256 464,141.1 370.9,48 256,48 Z m 75.3,260.7 -52.7,-52.7 52.7,-52.7 c 6.2,-6.2 6.2,-16.4 0,-22.6 -6.2,-6.2 -16.4,-6.2 -22.6,0 L 256,233.4 203.3,180.7 c -6.2,-6.2 -15.6,-7.1 -22.6,0 -7.1,7.1 -6,16.6 0,22.6 l 52.7,52.7 -52.7,52.7 c -6.7,6.7 -6.4,16.3 0,22.6 6.4,6.4 16.4,6.2 22.6,0 l 52.7,-52.7 52.7,52.7 c 6.2,6.2 16.4,6.2 22.6,0 6.3,-6.2 6.3,-16.4 0,-22.6 z"></Path>
</Button>
<Button Style="{StaticResource FlatCircleButtonStyle}"
Background="Yellow"
Margin="1"
Width="20"
Height="20"
Command="{Binding AddRatioCommand}"
CommandParameter="0">
<Path Stretch="Uniform" Fill="Green" Data="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"></Path>
</Button>
<Button Style="{StaticResource FlatCircleButtonStyle}"
Background="Yellow"
Margin="1"
Width="20"
Height="20"
Command="{Binding AddRatioCommand}"
CommandParameter="0.125">
<Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C13.93 5 15.68 5.78 16.95 7.05L12 12V5Z"></Path>
</Button>
<Button Style="{StaticResource FlatCircleButtonStyle}"
Background="Yellow"
Width="20"
Height="20"
Command="{Binding AddRatioCommand}"
CommandParameter="0.25">
<Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12H12V5Z"></Path>
</Button>
<Button Style="{StaticResource FlatCircleButtonStyle}"
Background="Yellow"
Margin="1"
Width="20"
Height="20"
Command="{Binding AddRatioCommand}"
CommandParameter="0.375">
<Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12C19 13.93 18.22 15.68 16.95 16.95L12 12V5Z"></Path>
</Button>
<Button Style="{StaticResource FlatCircleButtonStyle}"
Background="Yellow"
Margin="1"
Width="20"
Height="20"
Command="{Binding AddRatioCommand}"
CommandParameter="0.5">
<Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19V5Z"></Path>
</Button>
<Button Style="{StaticResource FlatCircleButtonStyle}"
Background="Yellow"
Margin="1"
Width="20"
Height="20"
Command="{Binding AddRatioCommand}"
CommandParameter="0.625">
<Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19C10.07 19 8.32 18.22 7.05 16.95L12 12V5Z"></Path>
</Button>
<Button Style="{StaticResource FlatCircleButtonStyle}"
Background="Yellow"
Margin="1"
Width="20"
Height="20"
Command="{Binding AddRatioCommand}"
CommandParameter="0.75">
<Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19C8.13 19 5 15.87 5 12H12V5Z"></Path>
</Button>
<Button Style="{StaticResource FlatCircleButtonStyle}"
Background="Yellow"
Margin="1"
Width="20"
Height="20"
Command="{Binding AddRatioCommand}"
CommandParameter="0.875">
<Path Stretch="Uniform" Fill="Green" Data="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19C8.13 19 5 15.87 5 12C5 10.07 5.78 8.32 7.05 7.05L12 12V5Z"></Path>
</Button>
<Button Style="{StaticResource FlatCircleButtonStyle}"
Background="Yellow"
Margin="1"
Width="20"
Height="20"
Command="{Binding AddRatioCommand}"
CommandParameter="1">
<Path Stretch="Uniform" Fill="Green" Data="m 256,76 c 48.1,0 93.3,18.7 127.3,52.7 34,34 52.7,79.2 52.7,127.3 0,48.1 -18.7,93.3 -52.7,127.3 -34,34 -79.2,52.7 -127.3,52.7 -48.1,0 -93.3,-18.7 -127.3,-52.7 C 94.7,349.3 76,304.1 76,256 76,207.9 94.7,162.7 128.7,128.7 162.7,94.7 207.9,76 256,76 m 0,-28 C 141.1,48 48,141.1 48,256 48,370.9 141.1,464 256,464 370.9,464 464,370.9 464,256 464,141.1 370.9,48 256,48 Z M 362.6,192.9 345,174.8 c -0.7,-0.8 -1.8,-1.2 -2.8,-1.2 -1.1,0 -2.1,0.4 -2.8,1.2 L 217.4,297.7 173,253.3 c -0.8,-0.8 -1.8,-1.2 -2.8,-1.2 -1,0 -2,0.4 -2.8,1.2 l -17.8,17.8 c -1.6,1.6 -1.6,4.1 0,5.7 l 56,56 c 3.6,3.6 8,5.7 11.7,5.7 5.3,0 9.9,-3.9 11.6,-5.5 H 229 L 362.7,198.6 c 1.4,-1.7 1.4,-4.2 -0.1,-5.7 z"></Path>
@@ -412,7 +424,7 @@
</Grid>
</Grid>
</TabItem>
<TabItem Header="外观">
<TabItem Header="外观" Height="30" Width="50">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@@ -440,7 +452,7 @@
<MenuItem Header="鱼骨头图" IsCheckable="True" IsChecked="{Binding MindType,Converter={dd:ConverterValueMapToBool Parameter='FishBone'}, ConverterParameter='FishBone'}" />
<MenuItem Header="逻辑结构图" IsCheckable="True" IsChecked="{Binding MindType,Converter={dd:ConverterValueMapToBool Parameter='Logical'}, ConverterParameter='Logical'}" />
<MenuItem Header="组织结构图" IsCheckable="True" IsChecked="{Binding MindType,Converter={dd:ConverterValueMapToBool Parameter='Organizational'}, ConverterParameter='Organizational'}" />
<MenuItem Header="天盘图" IsCheckable="True" IsChecked="{Binding MindType,Converter={dd:ConverterValueMapToBool Parameter='Celestial'}, ConverterParameter='Celestial'}" />
<MenuItem Header="天盘图" IsCheckable="True" IsEnabled="False" ToolTip="暂未完成" IsChecked="{Binding MindType,Converter={dd:ConverterValueMapToBool Parameter='Celestial'}, ConverterParameter='Celestial'}" />
</controls:DropDownButton.Items>
</controls:DropDownButton>
<Line Grid.Column="1" X1="0" Y1="0" X2="0" Y2="100" StrokeDashArray="1" Stroke="Gray" StrokeThickness="1"></Line>
@@ -595,7 +607,7 @@
</Grid>
</Grid>
</TabItem>
<TabItem Header="视图">
<TabItem Header="视图" Height="30" Width="50">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@@ -635,12 +647,12 @@
</StackPanel>
</controls:DropDownButton.Content>
<controls:DropDownButton.Items>
<MenuItem Header="全选" IsCheckable="True" Command="{Binding SelectAllCommand}" />
<MenuItem Header="反选" IsCheckable="True" Command="{Binding SelectInverseCommand}" />
<MenuItem Header="选择兄弟节点" IsCheckable="True" Command="{Binding SelectBrotherCommand}" />
<MenuItem Header="选择同级节点" IsCheckable="True" Command="{Binding SelectPearCommand}" />
<MenuItem Header="选择路径" IsCheckable="True" Command="{Binding SelectRouteCommand}" />
<MenuItem Header="选择子树" IsCheckable="True" Command="{Binding SelectChildCommand}" />
<MenuItem Header="全选" Command="{Binding SelectAllCommand}" />
<MenuItem Header="反选" Command="{Binding SelectInverseCommand}" />
<MenuItem Header="选择兄弟节点" Command="{Binding SelectBrotherCommand}" />
<MenuItem Header="选择同级节点" Command="{Binding SelectPearCommand}" />
<MenuItem Header="选择路径" Command="{Binding SelectRouteCommand}" />
<MenuItem Header="选择子树" Command="{Binding SelectChildCommand}" />
</controls:DropDownButton.Items>
</controls:DropDownButton>
<Line Grid.Column="2" X1="0" Y1="0" X2="0" Y2="100" StrokeDashArray="1" Stroke="Gray" StrokeThickness="1"></Line>
@@ -673,15 +685,46 @@
<TextBlock>适应窗口高度</TextBlock>
</StackPanel>
</Button>
</StackPanel>
<Line Grid.Column="4" X1="0" Y1="0" X2="0" Y2="100" StrokeDashArray="1" Stroke="Gray" StrokeThickness="1"></Line>
<Button Style="{StaticResource FlatButtonStyle}" Grid.Column="5" >
<Button Style="{StaticResource FlatButtonStyle}" Command="{Binding SearchDownCommand}" CommandParameter="{Binding ElementName=txtsearch,Path=Text}" Grid.Column="5" >
<StackPanel>
<Path Width="18" Height="18" Stretch="Uniform" Fill="Black" Data="M911.958045 890.721335l-241.415018-246.54112a336.369964 336.369964 0 1 0-58.095828 45.158522l247.029321 252.643623a36.859118 36.859118 0 0 0 51.749225 0 37.103218 37.103218 0 0 0 0.7323-51.261025zM176.240286 404.473897a261.431228 261.431228 0 1 1 261.431228 261.431228A261.675328 261.675328 0 0 1 176.240286 404.473897z"></Path>
<TextBlock>搜索</TextBlock>
</StackPanel>
</Button>
<Border BorderBrush="Gray" Grid.Column="6" BorderThickness="1" CornerRadius="3">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="txtsearch" Text="{Binding SearchText}" VerticalContentAlignment="Center" BorderThickness="0" Background="Transparent">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding SearchDownCommand}" CommandParameter="{Binding ElementName=txtsearch,Path=Text}"/>
</TextBox.InputBindings>
<i:Interaction.Triggers>
<i:EventTrigger EventName="LostFocus">
<i:InvokeCommandAction Command="{Binding SearchDownCommand}" CommandParameter="{Binding ElementName=txtsearch,Path=Text}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBox>
<Line X1="0" Y1="0" X2="0" Y2="100" Stroke="Gray" StrokeThickness="0.5" HorizontalAlignment="Right"></Line>
<Button Grid.Column="1" Padding="6,0" Style="{StaticResource FlatButtonStyle}" Command="{Binding SearchUpCommand}" CommandParameter="{Binding ElementName=txtsearch,Path=Text}">
<Path Width="10" Height="10" Stretch="Uniform" Fill="Black" Data="M17,13.41,12.71,9.17a1,1,0,0,0-1.42,0L7.05,13.41a1,1,0,0,0,0,1.42,1,1,0,0,0,1.41,0L12,11.29l3.54,3.54a1,1,0,0,0,.7.29,1,1,0,0,0,.71-.29A1,1,0,0,0,17,13.41Z"></Path>
</Button>
<Button Grid.Column="2" Padding="6,0" Style="{StaticResource FlatButtonStyle}" Command="{Binding SearchDownCommand}" CommandParameter="{Binding ElementName=txtsearch,Path=Text}">
<Path Width="10" Height="10" Stretch="Uniform" Fill="Black" Data="M17,9.17a1,1,0,0,0-1.41,0L12,12.71,8.46,9.17a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42l4.24,4.24a1,1,0,0,0,1.42,0L17,10.59A1,1,0,0,0,17,9.17Z"></Path>
</Button>
<Line X1="0" Y1="0" X2="150" Y2="0" Stroke="Gray" StrokeThickness="0.5" VerticalAlignment="Bottom" Grid.ColumnSpan="3"></Line>
<TextBlock Grid.Row="1" Grid.ColumnSpan="3" Text="{Binding SearchInfo}"/>
</Grid>
</Border>
</Grid>
</TabItem>
</TabControl>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -9,7 +9,7 @@
<Setter Property="Foreground" Value="Black" />
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="3" />
<Setter Property="Padding" Value="5" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">

View File

@@ -45,6 +45,14 @@ namespace AIStudio.Wpf.Mind.ViewModels
return Items.OfType<MindNode>().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<MindNode> items = new List<MindNode>();
@@ -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<MindNode> nodes = new List<MindNode>();
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<MindNode>().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<MindNode>())
@@ -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<MindNode> GetParent(MindNode node)
{
List<MindNode> mindnode = new List<MindNode>();
while (node.ParentNode != null)
{
mindnode.Add(node.ParentNode);
node = node.ParentNode;
}
return mindnode;
}
private List<MindNode> GetChildren(MindNode parent)
{
List<MindNode> mindnode = new List<MindNode>();
if (parent.Children != null)
{
foreach (var child in parent.Children)
{
mindnode.Add(child);
mindnode.AddRange(GetChildren(child));
}
}
return mindnode;
}
#endregion
}
}

View File

@@ -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;
}