mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-05-01 13:39:28 +08:00
自定义工具栏连接线显示
This commit is contained in:
@@ -21,365 +21,384 @@
|
|||||||
d:DesignHeight="300" d:DesignWidth="300">
|
d:DesignHeight="300" d:DesignWidth="300">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<conventer:StringPathConverter x:Key="stringPathConverter"/>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<conventer:IntVisibilityConverter x:Key="IntVisibilityConverter"/>
|
<ResourceDictionary>
|
||||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
<conventer:StringPathConverter x:Key="stringPathConverter"/>
|
||||||
<dd:EnumDescriptionConverter x:Key="EnumDescriptionConverter"/>
|
<conventer:IntVisibilityConverter x:Key="IntVisibilityConverter"/>
|
||||||
<command:CommandReference x:Key="DeleteItemCommandReference" Command="{Binding ToolBoxViewModel.DeleteItemCommand}"/>
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
<dd:MathConverter x:Key="MathAddConverter" Operation="Add" />
|
<dd:EnumDescriptionConverter x:Key="EnumDescriptionConverter"/>
|
||||||
|
<command:CommandReference x:Key="DeleteItemCommandReference" Command="{Binding ToolBoxViewModel.DeleteItemCommand}"/>
|
||||||
|
<dd:MathConverter x:Key="MathAddConverter" Operation="Add" />
|
||||||
|
|
||||||
|
|
||||||
<DataTemplate DataType="{x:Type model:ImageToolBoxData}">
|
<DataTemplate DataType="{x:Type model:ImageToolBoxData}">
|
||||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||||
<Rectangle Name="Border"
|
<Rectangle Name="Border"
|
||||||
StrokeThickness="1"
|
StrokeThickness="1"
|
||||||
StrokeDashArray="2"
|
StrokeDashArray="2"
|
||||||
Fill="Transparent"
|
Fill="Transparent"
|
||||||
SnapsToDevicePixels="true"/>
|
SnapsToDevicePixels="true"/>
|
||||||
<Image IsHitTestVisible="True"
|
<Image IsHitTestVisible="True"
|
||||||
Stretch="Fill"
|
Stretch="Fill"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Source="{Binding Icon, Converter={x:Static dd:ImageUrlConverter.Instance}}" />
|
Source="{Binding Icon, Converter={x:Static dd:ImageUrlConverter.Instance}}" />
|
||||||
</Grid>
|
|
||||||
<DataTemplate.Triggers>
|
|
||||||
<Trigger Property="IsMouseOver" Value="true">
|
|
||||||
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
|
||||||
</Trigger>
|
|
||||||
</DataTemplate.Triggers>
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type model:MediaToolBoxData}">
|
|
||||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
|
||||||
<Rectangle Name="Border"
|
|
||||||
StrokeThickness="1"
|
|
||||||
StrokeDashArray="2"
|
|
||||||
Fill="Transparent"
|
|
||||||
SnapsToDevicePixels="true"/>
|
|
||||||
<Image IsHitTestVisible="True"
|
|
||||||
Stretch="Fill"
|
|
||||||
Margin="2"
|
|
||||||
Source="{Binding Text, Converter={x:Static dd:ImageUrlConverter.Instance}}" />
|
|
||||||
</Grid>
|
|
||||||
<DataTemplate.Triggers>
|
|
||||||
<Trigger Property="IsMouseOver" Value="true">
|
|
||||||
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
|
||||||
</Trigger>
|
|
||||||
</DataTemplate.Triggers>
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type model:TextToolBoxData}">
|
|
||||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
|
||||||
<Rectangle Name="Border"
|
|
||||||
StrokeThickness="1"
|
|
||||||
StrokeDashArray="2"
|
|
||||||
Fill="Transparent"
|
|
||||||
SnapsToDevicePixels="true"/>
|
|
||||||
<Rectangle Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}" Margin="2"/>
|
|
||||||
<TextBlock Text="{Binding Text}" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
||||||
</Grid>
|
|
||||||
<DataTemplate.Triggers>
|
|
||||||
<Trigger Property="IsMouseOver" Value="true">
|
|
||||||
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
|
||||||
</Trigger>
|
|
||||||
</DataTemplate.Triggers>
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type model:EllipseTextToolBoxData}">
|
|
||||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
|
||||||
<Ellipse Name="Border"
|
|
||||||
StrokeThickness="1"
|
|
||||||
StrokeDashArray="2"
|
|
||||||
Fill="Transparent"
|
|
||||||
SnapsToDevicePixels="true"/>
|
|
||||||
<Ellipse Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}" Margin="2"/>
|
|
||||||
<TextBlock Text="{Binding Text}" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
||||||
</Grid>
|
|
||||||
<DataTemplate.Triggers>
|
|
||||||
<Trigger Property="IsMouseOver" Value="true">
|
|
||||||
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
|
||||||
</Trigger>
|
|
||||||
</DataTemplate.Triggers>
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type model:PathToolBoxData}">
|
|
||||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
|
||||||
<Rectangle Name="Border"
|
|
||||||
StrokeThickness="1"
|
|
||||||
StrokeDashArray="2"
|
|
||||||
Fill="Transparent"
|
|
||||||
SnapsToDevicePixels="true"/>
|
|
||||||
<Path Style="{StaticResource PathItemStyle}" ToolTip="Document" Margin="2"/>
|
|
||||||
</Grid>
|
|
||||||
<DataTemplate.Triggers>
|
|
||||||
<Trigger Property="IsMouseOver" Value="true">
|
|
||||||
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
|
||||||
</Trigger>
|
|
||||||
</DataTemplate.Triggers>
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type model:SvgToolBoxData}">
|
|
||||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
|
||||||
<Rectangle Name="Border"
|
|
||||||
StrokeThickness="1"
|
|
||||||
StrokeDashArray="2"
|
|
||||||
Fill="Transparent"
|
|
||||||
SnapsToDevicePixels="true"/>
|
|
||||||
<svg:PackSvg Width="Auto" Height="Auto" Path="{Binding Icon}" Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}"/>
|
|
||||||
</Grid>
|
|
||||||
<DataTemplate.Triggers>
|
|
||||||
<Trigger Property="IsMouseOver" Value="true">
|
|
||||||
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
|
||||||
</Trigger>
|
|
||||||
</DataTemplate.Triggers>
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type model:DesignerItemToolBoxData}">
|
|
||||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
|
||||||
<Grid.ContextMenu>
|
|
||||||
<ContextMenu>
|
|
||||||
<MenuItem Header="删除" Command="{StaticResource DeleteItemCommandReference}" CommandParameter="{Binding .}"/>
|
|
||||||
</ContextMenu>
|
|
||||||
</Grid.ContextMenu>
|
|
||||||
<Rectangle Name="Border"
|
|
||||||
StrokeThickness="1"
|
|
||||||
StrokeDashArray="2"
|
|
||||||
Fill="Transparent"
|
|
||||||
SnapsToDevicePixels="true"/>
|
|
||||||
<Viewbox Stretch="Uniform" DataContext="{Binding DesignerItemViewModel}" Margin="2">
|
|
||||||
<Grid Width="{Binding ItemWidth}" Height="{Binding ItemHeight}" IsHitTestVisible="False">
|
|
||||||
<ContentControl Content="{Binding .}" />
|
|
||||||
<TextBox Text="{Binding Text}"
|
|
||||||
IsReadOnly="True"
|
|
||||||
TextWrapping="Wrap"
|
|
||||||
Background ="Transparent"
|
|
||||||
BorderThickness="0"
|
|
||||||
Margin="5"
|
|
||||||
Foreground="{Binding FontViewModel.FontColor,Converter={StaticResource ColorBrushConverter}}"
|
|
||||||
FontSize="{Binding FontViewModel.FontSize}"
|
|
||||||
FontFamily="{Binding FontViewModel.FontFamily}"
|
|
||||||
FontWeight="{Binding FontViewModel.FontWeight}"
|
|
||||||
FontStyle="{Binding FontViewModel.FontStyle}"
|
|
||||||
FontStretch="{Binding FontViewModel.FontStretch}"
|
|
||||||
TextDecorations="{Binding FontViewModel.TextDecorations}"
|
|
||||||
HorizontalContentAlignment="{Binding FontViewModel.HorizontalAlignment}"
|
|
||||||
VerticalContentAlignment="{Binding FontViewModel.VerticalAlignment}"
|
|
||||||
TextBlock.LineHeight="{Binding FontViewModel.LineHeight}"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Viewbox>
|
<DataTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
||||||
|
</Trigger>
|
||||||
|
</DataTemplate.Triggers>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type model:MediaToolBoxData}">
|
||||||
|
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||||
|
<Rectangle Name="Border"
|
||||||
|
StrokeThickness="1"
|
||||||
|
StrokeDashArray="2"
|
||||||
|
Fill="Transparent"
|
||||||
|
SnapsToDevicePixels="true"/>
|
||||||
|
<Image IsHitTestVisible="True"
|
||||||
|
Stretch="Fill"
|
||||||
|
Margin="2"
|
||||||
|
Source="{Binding Text, Converter={x:Static dd:ImageUrlConverter.Instance}}" />
|
||||||
|
</Grid>
|
||||||
|
<DataTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
||||||
|
</Trigger>
|
||||||
|
</DataTemplate.Triggers>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type model:TextToolBoxData}">
|
||||||
|
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||||
|
<Rectangle Name="Border"
|
||||||
|
StrokeThickness="1"
|
||||||
|
StrokeDashArray="2"
|
||||||
|
Fill="Transparent"
|
||||||
|
SnapsToDevicePixels="true"/>
|
||||||
|
<Rectangle Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}" Margin="2"/>
|
||||||
|
<TextBlock Text="{Binding Text}" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||||
|
</Grid>
|
||||||
|
<DataTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
||||||
|
</Trigger>
|
||||||
|
</DataTemplate.Triggers>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type model:EllipseTextToolBoxData}">
|
||||||
|
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||||
|
<Ellipse Name="Border"
|
||||||
|
StrokeThickness="1"
|
||||||
|
StrokeDashArray="2"
|
||||||
|
Fill="Transparent"
|
||||||
|
SnapsToDevicePixels="true"/>
|
||||||
|
<Ellipse Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}" Margin="2"/>
|
||||||
|
<TextBlock Text="{Binding Text}" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||||
|
</Grid>
|
||||||
|
<DataTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
||||||
|
</Trigger>
|
||||||
|
</DataTemplate.Triggers>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type model:PathToolBoxData}">
|
||||||
|
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||||
|
<Rectangle Name="Border"
|
||||||
|
StrokeThickness="1"
|
||||||
|
StrokeDashArray="2"
|
||||||
|
Fill="Transparent"
|
||||||
|
SnapsToDevicePixels="true"/>
|
||||||
|
<Path Style="{StaticResource PathItemStyle}" ToolTip="Document" Margin="2"/>
|
||||||
|
</Grid>
|
||||||
|
<DataTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
||||||
|
</Trigger>
|
||||||
|
</DataTemplate.Triggers>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type model:SvgToolBoxData}">
|
||||||
|
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||||
|
<Rectangle Name="Border"
|
||||||
|
StrokeThickness="1"
|
||||||
|
StrokeDashArray="2"
|
||||||
|
Fill="Transparent"
|
||||||
|
SnapsToDevicePixels="true"/>
|
||||||
|
<svg:PackSvg Width="Auto" Height="Auto" Path="{Binding Icon}" Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}"/>
|
||||||
|
</Grid>
|
||||||
|
<DataTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
||||||
|
</Trigger>
|
||||||
|
</DataTemplate.Triggers>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type model:DesignerItemToolBoxData}">
|
||||||
|
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||||
|
<Grid.ContextMenu>
|
||||||
|
<ContextMenu>
|
||||||
|
<MenuItem Header="删除" Command="{StaticResource DeleteItemCommandReference}" CommandParameter="{Binding .}"/>
|
||||||
|
</ContextMenu>
|
||||||
|
</Grid.ContextMenu>
|
||||||
|
<Rectangle Name="Border"
|
||||||
|
StrokeThickness="1"
|
||||||
|
StrokeDashArray="2"
|
||||||
|
Fill="Transparent"
|
||||||
|
SnapsToDevicePixels="true"/>
|
||||||
|
<Viewbox Stretch="Uniform" DataContext="{Binding DesignerItemViewModel}" Margin="2">
|
||||||
|
<Grid Width="{Binding ItemWidth}" Height="{Binding ItemHeight}" IsHitTestVisible="False">
|
||||||
|
<ContentControl Content="{Binding .}" />
|
||||||
|
<TextBox Text="{Binding Text}"
|
||||||
|
IsReadOnly="True"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Background ="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
Margin="5"
|
||||||
|
Foreground="{Binding FontViewModel.FontColor,Converter={StaticResource ColorBrushConverter}}"
|
||||||
|
FontSize="{Binding FontViewModel.FontSize}"
|
||||||
|
FontFamily="{Binding FontViewModel.FontFamily}"
|
||||||
|
FontWeight="{Binding FontViewModel.FontWeight}"
|
||||||
|
FontStyle="{Binding FontViewModel.FontStyle}"
|
||||||
|
FontStretch="{Binding FontViewModel.FontStretch}"
|
||||||
|
TextDecorations="{Binding FontViewModel.TextDecorations}"
|
||||||
|
HorizontalContentAlignment="{Binding FontViewModel.HorizontalAlignment}"
|
||||||
|
VerticalContentAlignment="{Binding FontViewModel.VerticalAlignment}"
|
||||||
|
TextBlock.LineHeight="{Binding FontViewModel.LineHeight}"/>
|
||||||
|
</Grid>
|
||||||
|
</Viewbox>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<DataTemplate.Triggers>
|
<DataTemplate.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="true">
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</DataTemplate.Triggers>
|
</DataTemplate.Triggers>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate DataType="{x:Type model:MultipleDesignerItemToolBoxData}">
|
<DataTemplate DataType="{x:Type model:MultipleDesignerItemToolBoxData}">
|
||||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||||
<Grid.ContextMenu>
|
<Grid.ContextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<MenuItem Header="删除" Command="{StaticResource DeleteItemCommandReference}" CommandParameter="{Binding .}"/>
|
<MenuItem Header="删除" Command="{StaticResource DeleteItemCommandReference}" CommandParameter="{Binding .}"/>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</Grid.ContextMenu>
|
</Grid.ContextMenu>
|
||||||
<Rectangle Name="Border"
|
<Rectangle Name="Border"
|
||||||
StrokeThickness="1"
|
StrokeThickness="1"
|
||||||
StrokeDashArray="2"
|
StrokeDashArray="2"
|
||||||
Fill="Transparent"
|
Fill="Transparent"
|
||||||
SnapsToDevicePixels="true"/>
|
SnapsToDevicePixels="true"/>
|
||||||
<Viewbox Stretch="Uniform" Margin="2">
|
<Viewbox Stretch="Uniform" Margin="2">
|
||||||
<ItemsControl ItemsSource="{Binding SelectableDesignerItemViewModels}"
|
<ItemsControl ItemsSource="{Binding SelectableDesignerItemViewModels}"
|
||||||
Width="{Binding CanvasWidth}"
|
Width="{Binding CanvasWidth}"
|
||||||
Height="{Binding CanvasHeight}">
|
Height="{Binding CanvasHeight}">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<Canvas x:Name="rootCanvas"/>
|
<Canvas x:Name="rootCanvas"/>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.Template>
|
<ItemsControl.Template>
|
||||||
<ControlTemplate TargetType="{x:Type ItemsControl}">
|
<ControlTemplate TargetType="{x:Type ItemsControl}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</ItemsControl.Template>
|
</ItemsControl.Template>
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid Width="{Binding ItemWidth}" Height="{Binding ItemHeight}" IsHitTestVisible="False">
|
<Grid Width="{Binding ItemWidth}" Height="{Binding ItemHeight}" IsHitTestVisible="False">
|
||||||
<ContentControl Content="{Binding .}" Margin="2"/>
|
<ContentControl Content="{Binding .}" Margin="2"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
<ItemsControl.Resources>
|
<ItemsControl.ItemContainerStyle>
|
||||||
<Style TargetType="{x:Type ContentPresenter}">
|
<Style>
|
||||||
<Setter Property="Canvas.Left" Value="{Binding Left}" />
|
<Setter Property="Canvas.Left" Value="{Binding Left}" />
|
||||||
<Setter Property="Canvas.Top" Value="{Binding Top}" />
|
<Setter Property="Canvas.Top" Value="{Binding Top}" />
|
||||||
</Style>
|
<Style.Triggers>
|
||||||
</ItemsControl.Resources>
|
<DataTrigger Binding="{Binding IsConnection}" Value="True">
|
||||||
</ItemsControl>
|
<Setter Property="Canvas.Left" Value="{Binding Area.Left}" />
|
||||||
</Viewbox>
|
<Setter Property="Canvas.Top" Value="{Binding Area.Top}" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</ItemsControl.ItemContainerStyle>
|
||||||
|
<ItemsControl.Resources>
|
||||||
|
<DataTemplate DataType="{x:Type dd:ConnectionViewModel}">
|
||||||
|
<Grid>
|
||||||
|
<dd:LineControl x:Name="line"/>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.Resources>
|
||||||
|
</ItemsControl>
|
||||||
|
</Viewbox>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<DataTemplate.Triggers>
|
<DataTemplate.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="true">
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</DataTemplate.Triggers>
|
</DataTemplate.Triggers>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate DataType="{x:Type flowchartmodel:FlowchartToolBoxData}">
|
<DataTemplate DataType="{x:Type flowchartmodel:FlowchartToolBoxData}">
|
||||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||||
<Rectangle Name="Border"
|
<Rectangle Name="Border"
|
||||||
StrokeThickness="1"
|
StrokeThickness="1"
|
||||||
StrokeDashArray="2"
|
StrokeDashArray="2"
|
||||||
Fill="Transparent"
|
Fill="Transparent"
|
||||||
SnapsToDevicePixels="true"/>
|
SnapsToDevicePixels="true"/>
|
||||||
<Grid IsHitTestVisible="False">
|
<Grid IsHitTestVisible="False">
|
||||||
<ContentControl Style="{StaticResource CustomFlowNodeStyle}" Margin="2"/>
|
<ContentControl Style="{StaticResource CustomFlowNodeStyle}" Margin="2"/>
|
||||||
<TextBlock Text="{Binding Text}" Margin="5" TextWrapping="WrapWithOverflow" FontSize="9" Foreground="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
<TextBlock Text="{Binding Text}" Margin="5" TextWrapping="WrapWithOverflow" FontSize="9" Foreground="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<DataTemplate.Triggers>
|
<DataTemplate.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="true">
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</DataTemplate.Triggers>
|
</DataTemplate.Triggers>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate DataType="{x:Type sfcmodel:SFCToolBoxData}">
|
<DataTemplate DataType="{x:Type sfcmodel:SFCToolBoxData}">
|
||||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Kind,Converter={StaticResource EnumDescriptionConverter}}">
|
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Kind,Converter={StaticResource EnumDescriptionConverter}}">
|
||||||
<Rectangle Name="Border"
|
<Rectangle Name="Border"
|
||||||
StrokeThickness="1"
|
StrokeThickness="1"
|
||||||
StrokeDashArray="2"
|
StrokeDashArray="2"
|
||||||
Fill="Transparent"
|
Fill="Transparent"
|
||||||
SnapsToDevicePixels="true"/>
|
SnapsToDevicePixels="true"/>
|
||||||
<Grid IsHitTestVisible="False">
|
<Grid IsHitTestVisible="False">
|
||||||
<ContentControl Style="{StaticResource CustomSFCNodeStyle}" Margin="2" />
|
<ContentControl Style="{StaticResource CustomSFCNodeStyle}" Margin="2" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<DataTemplate.Triggers>
|
<DataTemplate.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="true">
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</DataTemplate.Triggers>
|
</DataTemplate.Triggers>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate DataType="{x:Type dd:ToolBoxCategory}">
|
<DataTemplate DataType="{x:Type dd:ToolBoxCategory}">
|
||||||
<Grid Visibility="{Binding IsChecked,Converter={StaticResource boolToVisibilityConverter}}">
|
<Grid Visibility="{Binding IsChecked,Converter={StaticResource boolToVisibilityConverter}}">
|
||||||
<Expander Header="{Binding Header}"
|
<Expander Header="{Binding Header}"
|
||||||
IsExpanded="{Binding IsExpanded}"
|
IsExpanded="{Binding IsExpanded}"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Foreground="{DynamicResource Fluent.Ribbon.Brushes.LabelTextBrush}"
|
Foreground="{DynamicResource Fluent.Ribbon.Brushes.LabelTextBrush}"
|
||||||
Style="{StaticResource AIStudio.DiagramApp.Styles.Expander}">
|
Style="{StaticResource AIStudio.DiagramApp.Styles.Expander}">
|
||||||
<ItemsControl ItemsSource="{Binding ToolBoxItems}">
|
<ItemsControl ItemsSource="{Binding ToolBoxItems}">
|
||||||
<ItemsControl.Template>
|
<ItemsControl.Template>
|
||||||
<ControlTemplate TargetType="{x:Type ItemsControl}">
|
<ControlTemplate TargetType="{x:Type ItemsControl}">
|
||||||
<Border BorderThickness="{TemplateBinding Border.BorderThickness}"
|
<Border BorderThickness="{TemplateBinding Border.BorderThickness}"
|
||||||
Padding="{TemplateBinding Control.Padding}"
|
Padding="{TemplateBinding Control.Padding}"
|
||||||
BorderBrush="{TemplateBinding Border.BorderBrush}"
|
BorderBrush="{TemplateBinding Border.BorderBrush}"
|
||||||
Background="{TemplateBinding Panel.Background}"
|
Background="{TemplateBinding Panel.Background}"
|
||||||
SnapsToDevicePixels="True">
|
SnapsToDevicePixels="True">
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
|
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</ItemsControl.Template>
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<WrapPanel Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ItemsControl}}, Path=ActualWidth}"/>
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
<ItemsControl.ItemContainerStyle>
|
||||||
|
<Style TargetType="{x:Type ContentPresenter}">
|
||||||
|
<Setter Property="Control.Padding"
|
||||||
|
Value="10" />
|
||||||
|
<Setter Property="ContentControl.HorizontalContentAlignment"
|
||||||
|
Value="Stretch" />
|
||||||
|
<Setter Property="ContentControl.VerticalContentAlignment"
|
||||||
|
Value="Stretch" />
|
||||||
|
<Setter Property="ToolTip"
|
||||||
|
Value="{Binding ToolTip}" />
|
||||||
|
<Setter Property="dd:DragAndDropProps.EnabledForDrag"
|
||||||
|
Value="True" />
|
||||||
|
</Style>
|
||||||
|
</ItemsControl.ItemContainerStyle>
|
||||||
|
</ItemsControl>
|
||||||
|
</Expander>
|
||||||
|
<Button Margin="5" ToolTip="移除" Command="{Binding DataContext.ToolBoxViewModel.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}" CommandParameter="{Binding .}" Width="16" Height="16" HorizontalAlignment="Right" VerticalAlignment="Top" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="Transparent">
|
||||||
|
<Path Stretch="Fill" Margin="2" Fill="Red" Data="M0.7,0 L5,4.3 L9.3,0 L10,0.7 L5.7,5 L10,9.3 L9.3,10 L5,5.7 L0.7,10 L0,9.3 L4.3,5 L0,0.7 z" ></Path>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
|
<DataTemplate DataType="{x:Type viewmodels:MineToolBoxCategory}">
|
||||||
|
<Grid Visibility="{Binding IsChecked,Converter={StaticResource boolToVisibilityConverter}}">
|
||||||
|
<Expander Header="{Binding Header}"
|
||||||
|
IsExpanded="{Binding IsExpanded}"
|
||||||
|
BorderThickness="0"
|
||||||
|
Background="Transparent"
|
||||||
|
Foreground="{DynamicResource Fluent.Ribbon.Brushes.LabelTextBrush}"
|
||||||
|
Style="{StaticResource AIStudio.DiagramApp.Styles.Expander}">
|
||||||
|
<Grid>
|
||||||
|
<Border BorderThickness="1" CornerRadius="5" Margin="5" Padding="10" Visibility="{Binding ToolBoxItems.Count, Converter={StaticResource IntVisibilityConverter}, ConverterParameter='0'}">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<LinearGradientBrush SpreadMethod="Repeat" StartPoint="0,5" EndPoint="5,0" MappingMode="Absolute">
|
||||||
|
<LinearGradientBrush.GradientStops>
|
||||||
|
<GradientStop Color="{DynamicResource Fluent.Ribbon.Colors.AccentBaseColor}" Offset="0"/>
|
||||||
|
<GradientStop Color="{DynamicResource Fluent.Ribbon.Colors.AccentBaseColor}" Offset="0.2"/>
|
||||||
|
<GradientStop Color="Transparent" Offset="0.4"/>
|
||||||
|
<GradientStop Color="Transparent" Offset="0.6"/>
|
||||||
|
<GradientStop Color="{DynamicResource Fluent.Ribbon.Colors.AccentBaseColor}" Offset="0.8"/>
|
||||||
|
<GradientStop Color="{DynamicResource Fluent.Ribbon.Colors.AccentBaseColor}" Offset="1"/>
|
||||||
|
</LinearGradientBrush.GradientStops>
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Border.BorderBrush>
|
||||||
|
|
||||||
|
<TextBlock Text="添加形状到我的符号" HorizontalAlignment="Center" Foreground="{DynamicResource GrayBrush2}"/>
|
||||||
</Border>
|
</Border>
|
||||||
</ControlTemplate>
|
<ItemsControl ItemsSource="{Binding ToolBoxItems}">
|
||||||
</ItemsControl.Template>
|
<ItemsControl.Template>
|
||||||
<ItemsControl.ItemsPanel>
|
<ControlTemplate TargetType="{x:Type ItemsControl}">
|
||||||
<ItemsPanelTemplate>
|
<Border BorderThickness="{TemplateBinding Border.BorderThickness}"
|
||||||
<WrapPanel Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ItemsControl}}, Path=ActualWidth}"/>
|
Padding="{TemplateBinding Control.Padding}"
|
||||||
</ItemsPanelTemplate>
|
BorderBrush="{TemplateBinding Border.BorderBrush}"
|
||||||
</ItemsControl.ItemsPanel>
|
Background="{TemplateBinding Panel.Background}"
|
||||||
<ItemsControl.ItemContainerStyle>
|
SnapsToDevicePixels="True">
|
||||||
<Style TargetType="{x:Type ContentPresenter}">
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<Setter Property="Control.Padding"
|
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
|
||||||
Value="10" />
|
</ScrollViewer>
|
||||||
<Setter Property="ContentControl.HorizontalContentAlignment"
|
</Border>
|
||||||
Value="Stretch" />
|
</ControlTemplate>
|
||||||
<Setter Property="ContentControl.VerticalContentAlignment"
|
</ItemsControl.Template>
|
||||||
Value="Stretch" />
|
<ItemsControl.ItemsPanel>
|
||||||
<Setter Property="ToolTip"
|
<ItemsPanelTemplate>
|
||||||
Value="{Binding ToolTip}" />
|
<WrapPanel Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ItemsControl}}, Path=ActualWidth}"/>
|
||||||
<Setter Property="dd:DragAndDropProps.EnabledForDrag"
|
</ItemsPanelTemplate>
|
||||||
Value="True" />
|
</ItemsControl.ItemsPanel>
|
||||||
</Style>
|
<ItemsControl.ItemContainerStyle>
|
||||||
</ItemsControl.ItemContainerStyle>
|
<Style TargetType="{x:Type ContentPresenter}">
|
||||||
</ItemsControl>
|
<Setter Property="Control.Padding"
|
||||||
</Expander>
|
Value="10" />
|
||||||
<Button Margin="5" ToolTip="移除" Command="{Binding DataContext.ToolBoxViewModel.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}" CommandParameter="{Binding .}" Width="16" Height="16" HorizontalAlignment="Right" VerticalAlignment="Top" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="Transparent">
|
<Setter Property="ContentControl.HorizontalContentAlignment"
|
||||||
<Path Stretch="Fill" Margin="2" Fill="Red" Data="M0.7,0 L5,4.3 L9.3,0 L10,0.7 L5.7,5 L10,9.3 L9.3,10 L5,5.7 L0.7,10 L0,9.3 L4.3,5 L0,0.7 z" ></Path>
|
Value="Stretch" />
|
||||||
</Button>
|
<Setter Property="ContentControl.VerticalContentAlignment"
|
||||||
</Grid>
|
Value="Stretch" />
|
||||||
</DataTemplate>
|
<Setter Property="ToolTip"
|
||||||
|
Value="{Binding ToolTip}" />
|
||||||
<DataTemplate DataType="{x:Type viewmodels:MineToolBoxCategory}">
|
<Setter Property="dd:DragAndDropProps.EnabledForDrag"
|
||||||
<Grid Visibility="{Binding IsChecked,Converter={StaticResource boolToVisibilityConverter}}">
|
Value="True" />
|
||||||
<Expander Header="{Binding Header}"
|
</Style>
|
||||||
IsExpanded="{Binding IsExpanded}"
|
</ItemsControl.ItemContainerStyle>
|
||||||
BorderThickness="0"
|
</ItemsControl>
|
||||||
Background="Transparent"
|
</Grid>
|
||||||
Foreground="{DynamicResource Fluent.Ribbon.Brushes.LabelTextBrush}"
|
</Expander>
|
||||||
Style="{StaticResource AIStudio.DiagramApp.Styles.Expander}">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top">
|
||||||
<Grid>
|
<Button Margin="0,5,2,5" ToolTip="导入到我的符号" Command="{Binding DataContext.ToolBoxViewModel.ImportItemCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}" Width="16" Height="16" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="Transparent">
|
||||||
<Border BorderThickness="1" CornerRadius="5" Margin="5" Padding="10" Visibility="{Binding ToolBoxItems.Count, Converter={StaticResource IntVisibilityConverter}, ConverterParameter='0'}">
|
<Path Stretch="Fill" Margin="2" Fill="{DynamicResource GrayBrush2}" Data="M14,12L10,8V11H2V13H10V16M20,18V6C20,4.89 19.1,4 18,4H6A2,2 0 0,0 4,6V9H6V6H18V18H6V15H4V18A2,2 0 0,0 6,20H18A2,2 0 0,0 20,18Z" ></Path>
|
||||||
<Border.BorderBrush>
|
</Button>
|
||||||
<LinearGradientBrush SpreadMethod="Repeat" StartPoint="0,5" EndPoint="5,0" MappingMode="Absolute">
|
<Button Margin="0,5,2,5" ToolTip="添加到我的符号" Command="{Binding DataContext.ToolBoxViewModel.AddCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}" Width="16" Height="16" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="Transparent">
|
||||||
<LinearGradientBrush.GradientStops>
|
<Path Stretch="Fill" Margin="2" Fill="{DynamicResource GrayBrush2}" Data="M938.666667 426.666667h-341.333334V85.333333c0-46.933333-38.4-85.333333-85.333333-85.333333s-85.333333 38.4-85.333333 85.333333v341.333334H85.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333s38.4 85.333333 85.333333 85.333333h341.333334v341.333334c0 46.933333 38.4 85.333333 85.333333 85.333333s85.333333-38.4 85.333333-85.333333v-341.333334h341.333334c46.933333 0 85.333333-38.4 85.333333-85.333333s-38.4-85.333333-85.333333-85.333333z" ></Path>
|
||||||
<GradientStop Color="{DynamicResource Fluent.Ribbon.Colors.AccentBaseColor}" Offset="0"/>
|
</Button>
|
||||||
<GradientStop Color="{DynamicResource Fluent.Ribbon.Colors.AccentBaseColor}" Offset="0.2"/>
|
<Button Margin="0,5,5,5" ToolTip="移除" Command="{Binding DataContext.ToolBoxViewModel.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}" CommandParameter="{Binding .}" Width="16" Height="16" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="Transparent">
|
||||||
<GradientStop Color="Transparent" Offset="0.4"/>
|
<Path Stretch="Fill" Margin="2" Fill="Red" Data="M0.7,0 L5,4.3 L9.3,0 L10,0.7 L5.7,5 L10,9.3 L9.3,10 L5,5.7 L0.7,10 L0,9.3 L4.3,5 L0,0.7 z" ></Path>
|
||||||
<GradientStop Color="Transparent" Offset="0.6"/>
|
</Button>
|
||||||
<GradientStop Color="{DynamicResource Fluent.Ribbon.Colors.AccentBaseColor}" Offset="0.8"/>
|
</StackPanel>
|
||||||
<GradientStop Color="{DynamicResource Fluent.Ribbon.Colors.AccentBaseColor}" Offset="1"/>
|
|
||||||
</LinearGradientBrush.GradientStops>
|
|
||||||
</LinearGradientBrush>
|
|
||||||
</Border.BorderBrush>
|
|
||||||
|
|
||||||
<TextBlock Text="添加形状到我的符号" HorizontalAlignment="Center" Foreground="{DynamicResource GrayBrush2}"/>
|
|
||||||
</Border>
|
|
||||||
<ItemsControl ItemsSource="{Binding ToolBoxItems}">
|
|
||||||
<ItemsControl.Template>
|
|
||||||
<ControlTemplate TargetType="{x:Type ItemsControl}">
|
|
||||||
<Border BorderThickness="{TemplateBinding Border.BorderThickness}"
|
|
||||||
Padding="{TemplateBinding Control.Padding}"
|
|
||||||
BorderBrush="{TemplateBinding Border.BorderBrush}"
|
|
||||||
Background="{TemplateBinding Panel.Background}"
|
|
||||||
SnapsToDevicePixels="True">
|
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
|
||||||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
|
|
||||||
</ScrollViewer>
|
|
||||||
</Border>
|
|
||||||
</ControlTemplate>
|
|
||||||
</ItemsControl.Template>
|
|
||||||
<ItemsControl.ItemsPanel>
|
|
||||||
<ItemsPanelTemplate>
|
|
||||||
<WrapPanel Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ItemsControl}}, Path=ActualWidth}"/>
|
|
||||||
</ItemsPanelTemplate>
|
|
||||||
</ItemsControl.ItemsPanel>
|
|
||||||
<ItemsControl.ItemContainerStyle>
|
|
||||||
<Style TargetType="{x:Type ContentPresenter}">
|
|
||||||
<Setter Property="Control.Padding"
|
|
||||||
Value="10" />
|
|
||||||
<Setter Property="ContentControl.HorizontalContentAlignment"
|
|
||||||
Value="Stretch" />
|
|
||||||
<Setter Property="ContentControl.VerticalContentAlignment"
|
|
||||||
Value="Stretch" />
|
|
||||||
<Setter Property="ToolTip"
|
|
||||||
Value="{Binding ToolTip}" />
|
|
||||||
<Setter Property="dd:DragAndDropProps.EnabledForDrag"
|
|
||||||
Value="True" />
|
|
||||||
</Style>
|
|
||||||
</ItemsControl.ItemContainerStyle>
|
|
||||||
</ItemsControl>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Expander>
|
</DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top">
|
|
||||||
<Button Margin="0,5,2,5" ToolTip="导入到我的符号" Command="{Binding DataContext.ToolBoxViewModel.ImportItemCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}" Width="16" Height="16" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="Transparent">
|
|
||||||
<Path Stretch="Fill" Margin="2" Fill="{DynamicResource GrayBrush2}" Data="M14,12L10,8V11H2V13H10V16M20,18V6C20,4.89 19.1,4 18,4H6A2,2 0 0,0 4,6V9H6V6H18V18H6V15H4V18A2,2 0 0,0 6,20H18A2,2 0 0,0 20,18Z" ></Path>
|
|
||||||
</Button>
|
|
||||||
<Button Margin="0,5,2,5" ToolTip="添加到我的符号" Command="{Binding DataContext.ToolBoxViewModel.AddCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}" Width="16" Height="16" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="Transparent">
|
|
||||||
<Path Stretch="Fill" Margin="2" Fill="{DynamicResource GrayBrush2}" Data="M938.666667 426.666667h-341.333334V85.333333c0-46.933333-38.4-85.333333-85.333333-85.333333s-85.333333 38.4-85.333333 85.333333v341.333334H85.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333s38.4 85.333333 85.333333 85.333333h341.333334v341.333334c0 46.933333 38.4 85.333333 85.333333 85.333333s85.333333-38.4 85.333333-85.333333v-341.333334h341.333334c46.933333 0 85.333333-38.4 85.333333-85.333333s-38.4-85.333333-85.333333-85.333333z" ></Path>
|
|
||||||
</Button>
|
|
||||||
<Button Margin="0,5,5,5" ToolTip="移除" Command="{Binding DataContext.ToolBoxViewModel.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}" CommandParameter="{Binding .}" Width="16" Height="16" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="Transparent">
|
|
||||||
<Path Stretch="Fill" Margin="2" Fill="Red" Data="M0.7,0 L5,4.3 L9.3,0 L10,0.7 L5.7,5 L10,9.3 L9.3,10 L5,5.7 L0.7,10 L0,9.3 L4.3,5 L0,0.7 z" ></Path>
|
|
||||||
</Button>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Expander x:Name="expanderLeft" ExpandDirection="Left" IsExpanded="{Binding IsExpanded, RelativeSource={RelativeSource AncestorType=views:ToolBoxControl}}" Style="{StaticResource AIStudio.DiagramApp.Styles.Expander.AutoHide}" Margin="0,0,1,0">
|
<Expander x:Name="expanderLeft" ExpandDirection="Left" IsExpanded="{Binding IsExpanded, RelativeSource={RelativeSource AncestorType=views:ToolBoxControl}}" Style="{StaticResource AIStudio.DiagramApp.Styles.Expander.AutoHide}" Margin="0,0,1,0">
|
||||||
|
|||||||
@@ -345,6 +345,14 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsConnection
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this is ConnectionViewModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private IColorViewModel _colorViewModel;
|
private IColorViewModel _colorViewModel;
|
||||||
public IColorViewModel ColorViewModel
|
public IColorViewModel ColorViewModel
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user