mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-05-03 22:41:30 +08:00
自定义工具栏连接线显示
This commit is contained in:
@@ -20,6 +20,8 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="300" d:DesignWidth="300">
|
d:DesignHeight="300" d:DesignWidth="300">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<conventer:StringPathConverter x:Key="stringPathConverter"/>
|
<conventer:StringPathConverter x:Key="stringPathConverter"/>
|
||||||
<conventer:IntVisibilityConverter x:Key="IntVisibilityConverter"/>
|
<conventer:IntVisibilityConverter x:Key="IntVisibilityConverter"/>
|
||||||
@@ -28,6 +30,7 @@
|
|||||||
<command:CommandReference x:Key="DeleteItemCommandReference" Command="{Binding ToolBoxViewModel.DeleteItemCommand}"/>
|
<command:CommandReference x:Key="DeleteItemCommandReference" Command="{Binding ToolBoxViewModel.DeleteItemCommand}"/>
|
||||||
<dd:MathConverter x:Key="MathAddConverter" Operation="Add" />
|
<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"
|
||||||
@@ -204,11 +207,24 @@
|
|||||||
</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.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding IsConnection}" Value="True">
|
||||||
|
<Setter Property="Canvas.Left" Value="{Binding Area.Left}" />
|
||||||
|
<Setter Property="Canvas.Top" Value="{Binding Area.Top}" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
</ItemsControl.ItemContainerStyle>
|
||||||
|
<ItemsControl.Resources>
|
||||||
|
<DataTemplate DataType="{x:Type dd:ConnectionViewModel}">
|
||||||
|
<Grid>
|
||||||
|
<dd:LineControl x:Name="line"/>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
</ItemsControl.Resources>
|
</ItemsControl.Resources>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
@@ -380,6 +396,9 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</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