2021-07-23 09:42:22 +08:00
|
|
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2022-10-28 22:45:39 +08:00
|
|
|
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.DiagramHelper.Extensions.ViewModels"
|
2021-07-23 09:42:22 +08:00
|
|
|
xmlns:gif="http://wpfanimatedgif.codeplex.com"
|
2022-10-28 22:45:39 +08:00
|
|
|
xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramHelper.Converters"
|
|
|
|
|
xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramHelper.Controls"
|
2022-11-30 19:07:40 +08:00
|
|
|
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
|
2021-07-23 09:42:22 +08:00
|
|
|
xmlns:Fluent="urn:fluent-ribbon"
|
2022-10-28 22:45:39 +08:00
|
|
|
xmlns:s="clr-namespace:AIStudio.Wpf.DiagramDesigner;assembly=AIStudio.Wpf.DiagramDesigner"
|
2021-07-23 09:42:22 +08:00
|
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors">
|
|
|
|
|
|
|
|
|
|
<converter:BoolVisibilityConverter x:Key="BoolVisibilityConverter"/>
|
|
|
|
|
<converter:DoubleToThickness x:Key="DoubleToThickness"/>
|
|
|
|
|
<s:ColorBrushConverter x:Key="ColorBrushConverter"/>
|
|
|
|
|
|
2021-07-29 13:55:18 +08:00
|
|
|
<DataTemplate DataType="{x:Type viewmodel:OutLineTextDesignerItemViewModel}">
|
2021-07-23 09:42:22 +08:00
|
|
|
<Viewbox Stretch="Fill" IsHitTestVisible="False">
|
|
|
|
|
<controls:OutlineText StrokePosition="Outside"
|
|
|
|
|
Text="{Binding Text}"
|
|
|
|
|
FontSize="{Binding FontViewModel.FontSize}"
|
|
|
|
|
FontFamily="{Binding FontViewModel.FontFamily}"
|
|
|
|
|
FontWeight="{Binding FontViewModel.FontWeight}"
|
|
|
|
|
FontStyle="{Binding FontViewModel.FontStyle}"
|
|
|
|
|
FontStretch="{Binding FontViewModel.FontStretch}"
|
|
|
|
|
TextDecorations="{Binding FontViewModel.TextDecorations}"
|
|
|
|
|
Stroke="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}"
|
|
|
|
|
StrokeThickness="{Binding ColorViewModel.LineWidth}"
|
|
|
|
|
Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}"/>
|
|
|
|
|
</Viewbox>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
|
|
<!-- DataTemplate for Popup look and feel -->
|
2021-07-29 13:55:18 +08:00
|
|
|
<DataTemplate DataType="{x:Type viewmodel:OutLineTextDesignerItemData}">
|
2021-07-23 09:42:22 +08:00
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Label Grid.Row="0"
|
|
|
|
|
Content="添加文本"
|
|
|
|
|
Margin="5" />
|
|
|
|
|
<TextBox Grid.Row="1"
|
|
|
|
|
Text="{Binding Text}"
|
|
|
|
|
FontSize="{Binding ElementName=comboBoxFontSize,Path=SelectedItem}"
|
|
|
|
|
FontFamily="{Binding ElementName=comboBoxFontName,Path=SelectedItem}"
|
|
|
|
|
FontWeight="{Binding ElementName=buttonBold,Path=IsChecked,Converter={converter:ConverterBoolToValueMap Parameter='Regular'}, ConverterParameter='Bold'}"
|
|
|
|
|
FontStyle="{Binding ElementName=buttonItalic,Path=IsChecked,Converter={converter:ConverterBoolToValueMap Parameter='Normal'}, ConverterParameter='Italic'}"
|
|
|
|
|
TextDecorations="{Binding ElementName=buttonUnderline,Path=IsChecked,Converter={converter:ConverterBoolToValueMap Parameter='None'}, ConverterParameter='Underline'}"
|
|
|
|
|
Height="100"
|
|
|
|
|
Margin="5"
|
|
|
|
|
TextWrapping="Wrap"/>
|
|
|
|
|
|
|
|
|
|
<StackPanel Grid.Row="2" Orientation="Horizontal">
|
|
|
|
|
<Fluent:ComboBox x:Name="comboBoxFontName"
|
|
|
|
|
Margin="5"
|
|
|
|
|
MinWidth="49"
|
|
|
|
|
Height="22"
|
|
|
|
|
BorderBrush="Gainsboro"
|
|
|
|
|
IsTextSearchEnabled="True"
|
|
|
|
|
ResizeMode="Vertical"
|
|
|
|
|
KeyTip="FF"
|
|
|
|
|
SizeDefinition="Small"
|
|
|
|
|
ScrollViewer.CanContentScroll="False"
|
|
|
|
|
ItemsSource="{x:Static dd:FontViewModel.FontFamilys}"
|
|
|
|
|
SelectedItem="{Binding FontViewModel.FontFamily}">
|
|
|
|
|
<Fluent:ComboBox.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<TextBlock Text="{Binding}"
|
|
|
|
|
FontFamily="{Binding}" />
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</Fluent:ComboBox.ItemTemplate>
|
|
|
|
|
</Fluent:ComboBox>
|
|
|
|
|
<Fluent:ComboBox x:Name="comboBoxFontSize"
|
|
|
|
|
Margin="5"
|
|
|
|
|
Width="49"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Height="22"
|
|
|
|
|
BorderBrush="Gainsboro"
|
|
|
|
|
IsEditable="True"
|
|
|
|
|
SizeDefinition="Small"
|
|
|
|
|
ResizeMode="Vertical"
|
|
|
|
|
KeyTip="FS"
|
|
|
|
|
ItemsSource="{x:Static dd:FontViewModel.FontSizes}"
|
|
|
|
|
SelectedItem="{Binding FontViewModel.FontSize}">
|
|
|
|
|
<Fluent:ComboBox.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<TextBlock Text="{Binding}"/>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</Fluent:ComboBox.ItemTemplate>
|
|
|
|
|
</Fluent:ComboBox>
|
|
|
|
|
<Fluent:ToggleButton KeyTip="B"
|
|
|
|
|
x:Name="buttonBold"
|
2022-10-28 22:45:39 +08:00
|
|
|
Icon="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Images/Bold.png"
|
2021-07-23 09:42:22 +08:00
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
SizeDefinition="Small"
|
|
|
|
|
IsChecked="{Binding FontViewModel.FontWeight,Converter={converter:ConverterValueMapToBool Parameter='Regular'}, ConverterParameter='Bold'}"/>
|
|
|
|
|
<Fluent:ToggleButton x:Name="buttonItalic"
|
|
|
|
|
KeyTip="I"
|
2022-10-28 22:45:39 +08:00
|
|
|
Icon="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Images/Italic.png"
|
2021-07-23 09:42:22 +08:00
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
SizeDefinition="Small"
|
|
|
|
|
IsChecked="{Binding FontViewModel.FontStyle,Converter={converter:ConverterValueMapToBool Parameter='Normal'}, ConverterParameter='Italic'}"/>
|
|
|
|
|
<Fluent:ToggleButton x:Name="buttonUnderline"
|
|
|
|
|
KeyTip="U"
|
2022-10-28 22:45:39 +08:00
|
|
|
Icon="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Images/Underline.png"
|
2021-07-23 09:42:22 +08:00
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
SizeDefinition="Small"
|
|
|
|
|
IsChecked="{Binding FontViewModel.Underline}"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ResourceDictionary>
|