2023-01-25 23:55:30 +08:00
|
|
|
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2023-03-05 21:30:53 +08:00
|
|
|
|
xmlns:dd="clr-namespace:AIStudio.Wpf.DiagramDesigner">
|
2023-01-25 23:55:30 +08:00
|
|
|
|
<!--TextBox水印样式-->
|
2023-07-08 18:00:14 +08:00
|
|
|
|
<Style TargetType="{x:Type TextBox}" x:Key="AIStudio.Diagram.Styles.TextBox">
|
2023-01-25 23:55:30 +08:00
|
|
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
|
|
|
|
<Setter Property="TextWrapping" Value="Wrap"/>
|
|
|
|
|
|
<Setter Property="Width" Value="Auto"/>
|
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<ControlTemplate TargetType="{x:Type TextBox}">
|
|
|
|
|
|
<Grid x:Name="PART_Root">
|
|
|
|
|
|
<Border x:Name="Bg" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
|
Background="{TemplateBinding Background}" />
|
|
|
|
|
|
<Grid x:Name="PART_InnerGrid">
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
|
|
<!--内容区域-->
|
|
|
|
|
|
<ScrollViewer x:Name="PART_ContentHost" BorderThickness="0" Grid.Column="1" IsTabStop="False" Margin="2"
|
|
|
|
|
|
VerticalAlignment="Stretch" Background="{x:Null}" >
|
|
|
|
|
|
</ScrollViewer>
|
|
|
|
|
|
<!--水印-->
|
|
|
|
|
|
<TextBlock x:Name="Message" Padding="{TemplateBinding Padding}" Visibility="Collapsed"
|
2023-03-05 21:30:53 +08:00
|
|
|
|
Text="{TemplateBinding dd:ControlAttachProperty.Watermark}" Grid.Column="1"
|
2023-01-25 23:55:30 +08:00
|
|
|
|
Foreground="{TemplateBinding Foreground}" IsHitTestVisible="False" Opacity="0.5"
|
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="5,2,5,2" />
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<!--显示水印-->
|
|
|
|
|
|
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Text}" Value="">
|
|
|
|
|
|
<Setter TargetName="Message" Property="Visibility" Value="Visible" />
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
|
|
<!--TextBox水印,阴影样式-->
|
2023-07-08 18:00:14 +08:00
|
|
|
|
<Style TargetType="{x:Type TextBox}" x:Key="AIStudio.Diagram.Styles.TextBox.Effect">
|
2023-01-25 23:55:30 +08:00
|
|
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
|
|
|
|
<Setter Property="TextWrapping" Value="Wrap"/>
|
|
|
|
|
|
<Setter Property="Width" Value="Auto"/>
|
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
|
|
|
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<ControlTemplate TargetType="{x:Type TextBox}">
|
|
|
|
|
|
<Grid x:Name="PART_Root">
|
|
|
|
|
|
<Border x:Name="Bg" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
|
Background="{TemplateBinding Background}" />
|
|
|
|
|
|
<Grid x:Name="PART_InnerGrid">
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
|
|
<!--内容区域-->
|
|
|
|
|
|
<ScrollViewer x:Name="PART_ContentHost" BorderThickness="0" Grid.Column="1" IsTabStop="False" Margin="2"
|
|
|
|
|
|
VerticalAlignment="Stretch" Background="{x:Null}" >
|
|
|
|
|
|
<ScrollViewer.Effect>
|
|
|
|
|
|
<DropShadowEffect x:Name="effect" Color="{Binding FontViewModel.TextEffectColor}" ></DropShadowEffect>
|
|
|
|
|
|
</ScrollViewer.Effect>
|
|
|
|
|
|
</ScrollViewer>
|
|
|
|
|
|
<!--水印-->
|
|
|
|
|
|
<TextBlock x:Name="Message" Padding="{TemplateBinding Padding}" Visibility="Collapsed"
|
2023-03-05 21:30:53 +08:00
|
|
|
|
Text="{TemplateBinding dd:ControlAttachProperty.Watermark}" Grid.Column="1"
|
2023-01-25 23:55:30 +08:00
|
|
|
|
Foreground="{TemplateBinding Foreground}" IsHitTestVisible="False" Opacity="0.5"
|
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="5,2,5,2" />
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<!--显示水印-->
|
|
|
|
|
|
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Text}" Value="">
|
|
|
|
|
|
<Setter TargetName="Message" Property="Visibility" Value="Visible" />
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
<DataTrigger Binding="{Binding FontViewModel.TextEffectColor}" Value="Transparent">
|
|
|
|
|
|
<Setter TargetName="PART_ContentHost" Property="Effect" Value="{x:Null}"/>
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</ResourceDictionary>
|