mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
59 lines
4.2 KiB
XML
59 lines
4.2 KiB
XML
<UserControl x:Class="AIStudio.Wpf.DiagramDesigner.TextControl"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:dd="clr-namespace:AIStudio.Wpf.DiagramDesigner"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="450" d:DesignWidth="800">
|
|
<UserControl.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="/AIStudio.Wpf.DiagramDesigner;component/Styles/TextBox.xaml" />
|
|
<ResourceDictionary>
|
|
<dd:ColorBrushConverter x:Key="ColorBrushConverter" />
|
|
<dd:TrueToFalseConverter x:Key="TrueToFalseConverter"/>
|
|
</ResourceDictionary>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
</ResourceDictionary>
|
|
</UserControl.Resources>
|
|
<Grid IsHitTestVisible="{Binding IsHitTestVisible}">
|
|
<TextBox x:Name="PART_TextBlock"
|
|
Text="{Binding Text, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
|
|
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}"
|
|
AcceptsReturn="{Binding AcceptsReturn,RelativeSource={RelativeSource AncestorType=dd:TextControl}}"
|
|
IsHitTestVisible="False"
|
|
dd:ControlAttachProperty.Watermark="{Binding Path=(dd:ControlAttachProperty.Watermark),RelativeSource={RelativeSource AncestorType={x:Type dd:TextControl}}}"
|
|
Style="{StaticResource WaterTextBoxWithEffect}" IsReadOnly="True">
|
|
|
|
</TextBox>
|
|
<TextBox x:Name="PART_ShowText"
|
|
Text="{Binding Text, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
|
|
Foreground="{Binding FontViewModel.FontColor,Converter={StaticResource ColorBrushConverter}}"
|
|
IsReadOnly="{Binding IsReadOnlyText}"
|
|
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}"
|
|
AcceptsReturn="{Binding AcceptsReturn,RelativeSource={RelativeSource AncestorType=dd:TextControl}}"
|
|
Focusable="False"
|
|
dd:ControlAttachProperty.Watermark="{Binding Path=(dd:ControlAttachProperty.Watermark),RelativeSource={RelativeSource AncestorType={x:Type dd:TextControl}}}"
|
|
Style="{StaticResource WaterTextBoxWithEffect}" Visibility="Collapsed">
|
|
</TextBox>
|
|
</Grid>
|
|
</UserControl>
|