mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-22 17:36:36 +08:00
xx
This commit is contained in:
@@ -99,65 +99,64 @@
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type dd:BlockDesignerItemViewModel}">
|
||||
<dd:BlockBorder>
|
||||
<Grid x:Name="grid" MinWidth="{Binding MinItemWidth}" MinHeight="{Binding MinItemHeight}">
|
||||
<Grid IsHitTestVisible="False">
|
||||
<Rectangle StrokeThickness="1" Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}" Stroke="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" />
|
||||
<Border x:Name="left" HorizontalAlignment="Left" Width="5" Background="Transparent"/>
|
||||
<Control x:Name="PART_Text" IsHitTestVisible="{Binding IsReadOnlyText,Converter={StaticResource InvertBoolConverter}}">
|
||||
<Control.Style>
|
||||
<Style TargetType="Control">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Grid/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ShowText}" Value="True">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<dd:TextControl x:Name="PART_Text" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Text,Converter={StaticResource NotNullOrEmptyToBoolConverter}}" Value="True">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<dd:TextControl x:Name="PART_Text" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding CustomText}" Value="True">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Grid/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Control.Style>
|
||||
</Control>
|
||||
</Grid>
|
||||
<dd:ItemsContainer x:Name="contain"
|
||||
<Grid x:Name="grid" MinWidth="{Binding MinItemWidth}" MinHeight="{Binding MinItemHeight}">
|
||||
<Grid IsHitTestVisible="False">
|
||||
<Rectangle StrokeThickness="1" Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}" Stroke="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" />
|
||||
<Border x:Name="left" HorizontalAlignment="Left" Width="5" Background="Transparent"/>
|
||||
<Control x:Name="PART_Text" IsHitTestVisible="{Binding IsReadOnlyText,Converter={StaticResource InvertBoolConverter}}">
|
||||
<Control.Style>
|
||||
<Style TargetType="Control">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Grid/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ShowText}" Value="True">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<dd:TextControl x:Name="PART_Text" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Text,Converter={StaticResource NotNullOrEmptyToBoolConverter}}" Value="True">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<dd:TextControl x:Name="PART_Text" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding CustomText}" Value="True">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Grid/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Control.Style>
|
||||
</Control>
|
||||
</Grid>
|
||||
<dd:BlockItemsContainer x:Name="contain"
|
||||
Margin="20"
|
||||
ParentPanel="{Binding ElementName=grid}"
|
||||
GetOffSetFunc="{Binding FirstContain.GetOffSetFunc,Mode=OneWayToSource}"
|
||||
Border="{Binding FirstContain}">
|
||||
<ItemsControl x:Name="items" ItemsSource="{Binding FirstContain.Children}">
|
||||
<dd:BlockItemsControl x:Name="items" ItemsSource="{Binding FirstContain.Children}">
|
||||
|
||||
</dd:BlockItemsControl>
|
||||
</dd:BlockItemsContainer>
|
||||
</Grid>
|
||||
|
||||
</ItemsControl>
|
||||
</dd:ItemsContainer>
|
||||
</Grid>
|
||||
</dd:BlockBorder>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding IsSelected}" Value="true">
|
||||
<Setter TargetName="left" Property="Background" Value="#3399FF"/>
|
||||
|
||||
Reference in New Issue
Block a user