2022-10-28 22:45:39 +08:00
|
|
|
<UserControl x:Class="AIStudio.Wpf.DiagramDesigner.TextControl"
|
2021-07-23 09:42:22 +08:00
|
|
|
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"
|
2023-03-05 21:30:53 +08:00
|
|
|
xmlns:dd="clr-namespace:AIStudio.Wpf.DiagramDesigner"
|
2021-07-23 09:42:22 +08:00
|
|
|
mc:Ignorable="d"
|
|
|
|
|
d:DesignHeight="450" d:DesignWidth="800">
|
|
|
|
|
<UserControl.Resources>
|
2023-01-25 23:55:30 +08:00
|
|
|
<ResourceDictionary>
|
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
|
|
|
<ResourceDictionary Source="/AIStudio.Wpf.DiagramDesigner;component/Styles/TextBox.xaml" />
|
|
|
|
|
<ResourceDictionary>
|
2023-03-05 21:30:53 +08:00
|
|
|
<dd:ColorBrushConverter x:Key="ColorBrushConverter" />
|
|
|
|
|
<dd:TrueToFalseConverter x:Key="TrueToFalseConverter"/>
|
2023-01-25 23:55:30 +08:00
|
|
|
</ResourceDictionary>
|
|
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
|
</ResourceDictionary>
|
2021-07-23 09:42:22 +08:00
|
|
|
</UserControl.Resources>
|
2023-01-23 15:43:44 +08:00
|
|
|
<Grid IsHitTestVisible="{Binding IsHitTestVisible}">
|
2021-07-23 09:42:22 +08:00
|
|
|
<TextBox x:Name="PART_TextBlock"
|
2023-04-08 21:48:43 +08:00
|
|
|
Text="{Binding Text, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
|
2021-07-23 09:42:22 +08:00
|
|
|
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}"
|
2023-05-03 23:42:34 +08:00
|
|
|
AcceptsReturn="{Binding AcceptsReturn,RelativeSource={RelativeSource AncestorType=dd:TextControl}}"
|
2023-01-27 20:10:17 +08:00
|
|
|
IsHitTestVisible="False"
|
2023-03-05 21:30:53 +08:00
|
|
|
dd:ControlAttachProperty.Watermark="{Binding Path=(dd:ControlAttachProperty.Watermark),RelativeSource={RelativeSource AncestorType={x:Type dd:TextControl}}}"
|
2023-07-08 18:00:14 +08:00
|
|
|
Style="{StaticResource AIStudio.Diagram.Styles.TextBox.Effect}" IsReadOnly="True">
|
2021-07-23 09:42:22 +08:00
|
|
|
|
|
|
|
|
</TextBox>
|
|
|
|
|
<TextBox x:Name="PART_ShowText"
|
2023-04-08 21:48:43 +08:00
|
|
|
Text="{Binding Text, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
|
2021-07-23 09:42:22 +08:00
|
|
|
Foreground="{Binding FontViewModel.FontColor,Converter={StaticResource ColorBrushConverter}}"
|
2021-07-27 16:15:30 +08:00
|
|
|
IsReadOnly="{Binding IsReadOnlyText}"
|
2021-07-23 09:42:22 +08:00
|
|
|
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}"
|
2023-05-03 23:42:34 +08:00
|
|
|
AcceptsReturn="{Binding AcceptsReturn,RelativeSource={RelativeSource AncestorType=dd:TextControl}}"
|
2023-03-12 15:26:58 +08:00
|
|
|
Focusable="False"
|
2023-03-05 21:30:53 +08:00
|
|
|
dd:ControlAttachProperty.Watermark="{Binding Path=(dd:ControlAttachProperty.Watermark),RelativeSource={RelativeSource AncestorType={x:Type dd:TextControl}}}"
|
2023-07-08 18:00:14 +08:00
|
|
|
Style="{StaticResource AIStudio.Diagram.Styles.TextBox.Effect}" Visibility="Collapsed">
|
2023-03-12 15:26:58 +08:00
|
|
|
</TextBox>
|
2021-07-23 09:42:22 +08:00
|
|
|
</Grid>
|
|
|
|
|
</UserControl>
|