mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-04 16:16:34 +08:00
block
This commit is contained in:
@@ -7,17 +7,59 @@
|
||||
xmlns:dd="clr-namespace:AIStudio.Wpf.DiagramDesigner"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<ItemsControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ControlTemplate x:Key="BlockConnectorDecoratorTemplate"
|
||||
TargetType="{x:Type Control}">
|
||||
<Grid Margin="{Binding ConnectorMargin}">
|
||||
<dd:BlockConnector
|
||||
Content="{Binding LeftConnector}"
|
||||
SnapsToDevicePixels="True"
|
||||
Orientation="Left"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Left"/>
|
||||
<dd:BlockConnector
|
||||
Content="{Binding TopConnector}"
|
||||
SnapsToDevicePixels="True"
|
||||
Orientation="Top"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
<dd:BlockConnector
|
||||
Content="{Binding RightConnector}"
|
||||
SnapsToDevicePixels="True"
|
||||
Orientation="Right"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Right"/>
|
||||
<dd:BlockConnector
|
||||
Content="{Binding BottomConnector}"
|
||||
SnapsToDevicePixels="True"
|
||||
Orientation="Bottom"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</ResourceDictionary>
|
||||
</ItemsControl.Resources>
|
||||
|
||||
<ItemsControl.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type ListBoxItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
||||
<dd:BlockBorder
|
||||
<dd:BlockGrid
|
||||
dd:WidthAndHeightProps.Active="True"
|
||||
dd:WidthAndHeightProps.BoundActualWidth="{Binding ActualItemWidth,Mode=OneWayToSource}"
|
||||
dd:WidthAndHeightProps.BoundActualHeight="{Binding ActualItemHeight,Mode=OneWayToSource}">
|
||||
<ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
|
||||
</dd:BlockBorder>
|
||||
<!-- PART_ConnectorDecorator -->
|
||||
<Control x:Name="PART_ConnectorDecorator" Template="{StaticResource BlockConnectorDecoratorTemplate}"/>
|
||||
</dd:BlockGrid>
|
||||
|
||||
<ControlTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding Connectors.Count}" Value="0">
|
||||
<Setter TargetName="PART_ConnectorDecorator" Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
Reference in New Issue
Block a user