mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
187 lines
21 KiB
XML
187 lines
21 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:controls="clr-namespace:AIStudio.Wpf.Mind.Controls"
|
|
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram">
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Mind;component/Themes/MindNode.xaml"/>
|
|
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Mind;component/Styles/Button.xaml" />
|
|
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ComboBox.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
|
<dd:ObjectConverter x:Key="ObjectConverter"/>
|
|
|
|
<Style x:Key="AIStudio.Styles.MindEditor" TargetType="{x:Type controls:MindEditor}">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type controls:MindEditor}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<!-- ToolBox Control -->
|
|
<ContentControl x:Name="PART_ContentControl" Template="{Binding ToolBox,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
|
|
|
<!-- Diagram Control -->
|
|
<dd:DiagramControl Grid.Row="1" x:Name="PART_DiagramControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
|
|
|
|
<Border x:Name="PART_SearchControl" Grid.Row="1" BorderBrush="Gray" Background="White" BorderThickness="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,1,1,0"
|
|
Visibility="{Binding ShowSearch,Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<Grid Grid.IsSharedSizeScope="True">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid Height="24">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" SharedSizeGroup="Column1"/>
|
|
<ColumnDefinition Width="*" SharedSizeGroup="Column2"/>
|
|
<ColumnDefinition Width="Auto" SharedSizeGroup="Column3"/>
|
|
<ColumnDefinition Width="Auto" SharedSizeGroup="Column4"/>
|
|
<ColumnDefinition Width="Auto" SharedSizeGroup="Column5"/>
|
|
</Grid.ColumnDefinitions>
|
|
<ToggleButton x:Name="replaceToggle" Width="20" Height="20" Padding="5,0" ToolTip="查找与替换切换">
|
|
<ToggleButton.Style>
|
|
<Style BasedOn="{StaticResource FlatButtonStyle}" TargetType="{x:Type ToggleButton}">
|
|
<Setter Property="Content">
|
|
<Setter.Value>
|
|
<Path Stretch="Uniform" Fill="Black" Data="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"></Path>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Trigger.Setters>
|
|
<Setter Property="Content">
|
|
<Setter.Value>
|
|
<Path Stretch="Uniform" Fill="Black" Data="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z"></Path>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger.Setters>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ToggleButton.Style>
|
|
</ToggleButton>
|
|
<TextBox Grid.Column="1" Width="200" x:Name="txtsearch" Text="{Binding SearchText,Mode=OneWayToSource}" 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 Grid.Column="1" X1="0" Y1="0" X2="0" Y2="100" Stroke="Gray" StrokeThickness="0.5" HorizontalAlignment="Right"></Line>
|
|
<Button Grid.Column="2" Width="20" Height="20" Padding="5,0" ToolTip="查找上一个" Style="{StaticResource FlatButtonStyle}" Command="{Binding SearchUpCommand}" CommandParameter="{Binding ElementName=txtsearch,Path=Text}">
|
|
<Path Stretch="Uniform" Fill="Black" Data="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"></Path>
|
|
</Button>
|
|
<Button Grid.Column="3" Width="20" Height="20" Padding="5,0" ToolTip="查找下一个" Style="{StaticResource FlatButtonStyle}" Command="{Binding SearchDownCommand}" CommandParameter="{Binding ElementName=txtsearch,Path=Text}">
|
|
<Path Stretch="Uniform" Fill="Black" Data="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"></Path>
|
|
</Button>
|
|
<Button Grid.Column="4" Width="20" Height="20" Padding="5,0" ToolTip="关闭" Style="{StaticResource FlatButtonStyle}" Command="{Binding CloseSearchCommand}">
|
|
<Path Stretch="Uniform" Fill="Black" Data="M500 455.8125L727.875 227.8749999999999L772.1250000000001 272.0625L544.1875 500L772.1250000000001 727.875L727.9375 772.125L500 544.1875L272.125 772.125L227.9375000000001 727.875L455.8125 500L227.9375000000001 272.125L272.125 227.8749999999999L500 455.8125z"></Path>
|
|
</Button>
|
|
<Line Grid.ColumnSpan="5" X1="0" Y1="0" X2="300" Y2="0" Stroke="Gray" StrokeThickness="0.5" VerticalAlignment="Bottom"></Line>
|
|
</Grid>
|
|
<Grid Grid.Row="1" Height="24" Visibility="{Binding ElementName=replaceToggle,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" SharedSizeGroup="Column1"/>
|
|
<ColumnDefinition Width="*" SharedSizeGroup="Column2"/>
|
|
<ColumnDefinition Width="Auto" SharedSizeGroup="Column3"/>
|
|
<ColumnDefinition Width="Auto" SharedSizeGroup="Column4"/>
|
|
<ColumnDefinition Width="Auto" SharedSizeGroup="Column5"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBox Grid.Column="1" x:Name="txtreplace" Text="{Binding ReplaceText,Mode=OneWayToSource}" VerticalContentAlignment="Center" BorderThickness="0" Background="Transparent">
|
|
</TextBox>
|
|
<Line Grid.Column="1" X1="0" Y1="0" X2="0" Y2="100" Stroke="Gray" StrokeThickness="0.5" HorizontalAlignment="Right"></Line>
|
|
<Button Grid.Column="2" Width="20" Height="20" Padding="5,0" ToolTip="替换" Style="{StaticResource FlatButtonStyle}" Command="{Binding ReplaceCommand}">
|
|
<Button.CommandParameter>
|
|
<MultiBinding Converter="{StaticResource ObjectConverter}">
|
|
<MultiBinding.Bindings>
|
|
<Binding ElementName="txtsearch" Path="Text"/>
|
|
<Binding ElementName="txtreplace" Path="Text"/>
|
|
</MultiBinding.Bindings>
|
|
</MultiBinding>
|
|
</Button.CommandParameter>
|
|
<Path Stretch="Uniform" Fill="Black" Data="M940.3 761.5c-8.5-13.3-19.3-24.8-31.9-34.1 13.3-19.5 20.7-43.7 20.7-69.2 0-61.5-43-111.5-95.9-111.5H671.8c-29.3 0-53.1 23.8-53.1 53.1v304c0 29.3 23.8 53.1 53.1 53.1h160.4c34.3 0 66.6-13.5 90.9-37.9 24.1-24.2 37.3-56 37.1-89.7 0-24.2-6.9-47.6-19.9-67.8z m-67.6 107.7c-10.6 10.6-24.7 16.5-39.5 16.5H689.8V773.6h143.3c14.8 0 28.9 5.9 39.5 16.5 10.6 10.6 16.5 24.7 16.5 39.5s-5.8 29-16.4 39.6z m-25.3-178.9c-2.1 2.5-7.7 8.4-14.3 8.4H689.8v-80.9h143.3c6.6 0 12.2 5.9 14.3 8.4 6.6 8 10.6 20 10.6 32.1 0 12-3.9 24-10.6 32zM456 406.6l-128-320C322.5 73 309.3 64 294.5 64h-64c-14.7 0-28 9-33.4 22.6l-128 320c-7.4 18.5 1.6 39.4 20.1 46.8 18.5 7.4 39.4-1.6 46.8-20.1L178.1 328H347l42.1 105.4c5.6 14.1 19.1 22.6 33.4 22.6 4.5 0 9-0.8 13.4-2.6 18.5-7.4 27.5-28.3 20.1-46.8zM206.9 256l48-120h15.3l48 120H206.9z m345.8 582.3l-113.5 67c-5.7 3.4-12 5-18.3 5-12.3 0-24.3-6.3-31-17.7-10.1-17.1-4.4-39.2 12.7-49.3l38.9-23c-47.1-14.5-88.6-35.2-124.1-62-40.2-30.3-72.5-68.1-96-112.5-39.9-75.3-40.6-143.8-40.6-146.7v-0.1c0-19.9 16.1-36 36-36s35.9 16.1 36 35.9v-0.2c0 0.6 1 56.1 33.6 116 18.7 34.4 44.3 63.8 75.9 87.2 29 21.5 63.4 38.3 102.6 50.1l-23-44.1c-9.2-17.6-2.4-39.4 15.3-48.6 17.6-9.2 39.4-2.4 48.6 15.3l60.5 115.9c8.9 17.1 2.9 38.1-13.6 47.8z"></Path>
|
|
</Button>
|
|
<Button Grid.Column="3" Width="20" Height="20" Padding="5,0" ToolTip="全部替换" Style="{StaticResource FlatButtonStyle}" Command="{Binding ReplaceAllCommand}">
|
|
<Button.CommandParameter>
|
|
<MultiBinding Converter="{StaticResource ObjectConverter}">
|
|
<MultiBinding.Bindings>
|
|
<Binding ElementName="txtsearch" Path="Text"/>
|
|
<Binding ElementName="txtreplace" Path="Text"/>
|
|
</MultiBinding.Bindings>
|
|
</MultiBinding>
|
|
</Button.CommandParameter>
|
|
<Path Stretch="Uniform" Fill="Black" Data="M618.368 905.813333a88.32 88.32 0 0 1-87.082667-87.082666v-209.408a88.362667 88.362667 0 0 1 87.082667-87.082667h209.408a88.234667 88.234667 0 0 1 87.082667 87.082667v209.408a88.192 88.192 0 0 1-87.082667 87.082666z m-22.912-296.490666v209.408a24.448 24.448 0 0 0 22.912 22.997333h209.408a24.704 24.704 0 0 0 23.168-22.997333v-209.408a24.661333 24.661333 0 0 0-23.168-22.912h-209.408a24.448 24.448 0 0 0-23.04 22.912zM224.853333 826.666667a260.010667 260.010667 0 0 1-69.077333-169.514667h-33.237333l66.090666-110.250667 66.346667 110.250667H219.733333a196.266667 196.266667 0 0 0 51.2 125.354667 213.333333 213.333333 0 0 0 148.992 59.264 32.042667 32.042667 0 1 1 0 64 277.034667 277.034667 0 0 1-195.029333-79.274667z m-28.842666-324.821334a88.405333 88.405333 0 0 1-87.082667-87.082666v-209.066667a88.448 88.448 0 0 1 87.082667-87.338667h209.408a88.405333 88.405333 0 0 1 87.082666 87.338667v209.066667a86.144 86.144 0 0 1-87.082666 87.082666z m-23.168-296.32v209.066667a24.917333 24.917333 0 0 0 23.168 23.168h209.408a22.272 22.272 0 0 0 23.168-23.168v-209.066667a24.704 24.704 0 0 0-23.168-23.168H196.010667a24.704 24.704 0 0 0-23.082667 23.125334z m596.181333 165.077334h35.328a196.693333 196.693333 0 0 0-51.2-128.853334 213.333333 213.333333 0 0 0-149.333333-59.434666 32.085333 32.085333 0 0 1 0-64 277.333333 277.333333 0 0 1 195.157333 79.232 261.205333 261.205333 0 0 1 69.504 173.184h32.853333l-62.421333 110.250666z"></Path>
|
|
</Button>
|
|
<Line Grid.ColumnSpan="5" X1="0" Y1="0" X2="300" Y2="0" Stroke="Gray" StrokeThickness="0.5" VerticalAlignment="Bottom"></Line>
|
|
</Grid>
|
|
<Grid Grid.Row="2" Height="24">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" SharedSizeGroup="Column1"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
|
<ToggleButton Width="20" Height="20" Padding="2,0" ToolTip="区分大小写" IsChecked="{Binding SearchCaseMatch}">
|
|
<Path Stretch="Uniform" Fill="Black" Data="M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.19,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6Z"></Path>
|
|
<ToggleButton.Style>
|
|
<Style BasedOn="{StaticResource FlatButtonStyle}" TargetType="{x:Type ToggleButton}">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Trigger.Setters>
|
|
<Setter Property="Background" Value="#cce4f7" />
|
|
</Trigger.Setters>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ToggleButton.Style>
|
|
</ToggleButton>
|
|
<ToggleButton Width="20" Height="20" Padding="2,0" ToolTip="全字匹配" IsChecked="{Binding SearchWholeWordMatch}">
|
|
<Path Stretch="Uniform" Fill="Black" RenderTransformOrigin="0.5,0.5" Data="M62.5 875H937.5V812.5H62.5V875zM875 750H812.5V250H875V750zM704.5 475.8125A147.06250000000003 147.06250000000003 0 0 1 682 524.9375A109.125 109.125 0 0 1 643.9375 558.0625A114.5 114.5 0 0 1 589.8125000000001 570.125C577.4375 570.125 566.0625 568.625 555.625 565.5624999999999A109.99999999999999 109.99999999999999 0 0 1 527.3125000000001 552.7499999999999A107.75 107.75 0 0 1 504.5000000000001 532.875L493.3125000000001 516.75V713.875H437.5V250H493.3125V285.9375L501.1875 274.9999999999999C506.625 268.6249999999999 513 263.1249999999999 520.1875 258.1874999999999C527.5000000000001 253.3124999999999 535.7500000000001 249.4374999999999 545.0625 246.5624999999999C554.375 243.6875 564.6875 242.3124999999999 576.1875 242.3124999999999C598.25 242.3124999999999 617.8125 246.7499999999999 634.7499999999999 255.5624999999999C651.7499999999999 264.5 665.9375 276.6874999999999 677.375 292.1874999999999C688.8124999999999 307.8124999999999 697.4374999999999 326.1249999999999 703.2499999999999 347.1249999999999C709.0624999999999 368.2499999999999 712 391.0624999999999 712 415.6874999999999A234.74999999999997 234.74999999999997 0 0 1 704.5 475.8124999999999zM612.0625 513.75C621.4999999999999 509.3125 629.6875 502.75 636.4375 494.1250000000001C643.25 485.375 648.5625 474.5625 652.375 461.8125000000001C655.5625 450.9375000000001 657.5000000000001 438.625 657.9375000000001 425.1250000000001L657.5000000000001 417.3125000000001C657.5000000000001 396.8750000000001 655.4375000000001 378.5625000000001 651.2500000000001 363.0000000000001A117.87500000000001 117.87500000000001 0 0 0 633.8750000000001 324.625C626.5625 314.5 617.6250000000001 306.8125 607.5625000000001 301.7500000000001C587.4375000000001 291.625 560.0625000000001 291.375 540.7500000000001 300.8125A79 79 0 0 0 516.1875 319.3125A79.5625 79.5625 0 0 0 502.5625 342.25S491.375 370.1874999999999 491.375 401.4374999999999C491.375 432.6874999999999 502.5625 464.0624999999999 502.5625 464.0624999999999C506.4375 475.1249999999999 511.0625 483.9374999999999 516.5625 490.9374999999999C523.6875000000001 499.8749999999999 532.5625 507.1249999999999 543.0625 512.4999999999999C553.5625 517.875 565.875 520.5625 579.75 520.5625C591.625 520.5625 602.5 518.25 612.0625 513.75zM937.5 187.5H62.5V125H937.5V187.5zM175.8125 375L130.3125 248.0625H62.5L64.0625 252.5624999999999L216.625 695.4375H275.4375L430.75 248.0624999999999H363.125L314.5 375H175.8125zM245.875 598.625H244.5000000000001L187.9375 426.5625H303.0000000000001L245.8750000000001 598.625z">
|
|
<Path.RenderTransform>
|
|
<ScaleTransform ScaleY="-1"/>
|
|
</Path.RenderTransform>
|
|
</Path>
|
|
<ToggleButton.Style>
|
|
<Style BasedOn="{StaticResource FlatButtonStyle}" TargetType="{x:Type ToggleButton}">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Trigger.Setters>
|
|
<Setter Property="Background" Value="#cce4f7" />
|
|
</Trigger.Setters>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ToggleButton.Style>
|
|
</ToggleButton>
|
|
<TextBlock Grid.Column="1" Margin="2,0,0,0" VerticalAlignment="Center" Text="{Binding SearchInfo}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="AIStudio.Styles.MindEditor.Default" TargetType="{x:Type controls:MindEditor}" BasedOn="{StaticResource AIStudio.Styles.MindEditor}">
|
|
<Setter Property="ToolBox">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Control">
|
|
<controls:MindToolBoxControl />
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style TargetType="{x:Type controls:MindEditor}" BasedOn="{StaticResource AIStudio.Styles.MindEditor.Default}" />
|
|
</ResourceDictionary>
|