You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
758 lines
32 KiB
758 lines
32 KiB
<!--***********************************************************************************
|
|
|
|
Toolkit for WPF
|
|
|
|
Copyright (C) 2007-2025 Xceed Software Inc.
|
|
|
|
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
|
|
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
|
|
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
|
|
|
|
For more features, controls, and fast professional support,
|
|
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
|
|
|
|
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
|
|
|
|
**********************************************************************************-->
|
|
|
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit"
|
|
xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters">
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="..\..\Themes\Generic\Glyphs.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
<conv:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" />
|
|
<conv:PrintableFontFamilyConverter x:Key="PrintableFontFamilyConverter" />
|
|
|
|
<ControlTemplate x:Key="ThumbControlTemplate"
|
|
TargetType="{x:Type Thumb}">
|
|
<Border Background="Transparent"
|
|
Cursor="Hand"
|
|
ToolTip="Click to Drag">
|
|
<StackPanel VerticalAlignment="Center"
|
|
Width="75">
|
|
<Line SnapsToDevicePixels="True"
|
|
Stretch="Fill"
|
|
StrokeDashArray="1,2"
|
|
StrokeThickness="1"
|
|
X1="0"
|
|
X2="1"
|
|
Margin=".5">
|
|
<Line.Stroke>
|
|
<SolidColorBrush Color="Gray" />
|
|
</Line.Stroke>
|
|
</Line>
|
|
<Line SnapsToDevicePixels="True"
|
|
Stretch="Fill"
|
|
StrokeDashArray="1,2"
|
|
StrokeThickness="1"
|
|
X1="0"
|
|
X2="1"
|
|
Margin=".5">
|
|
<Line.Stroke>
|
|
<SolidColorBrush Color="Gray" />
|
|
</Line.Stroke>
|
|
</Line>
|
|
<Line SnapsToDevicePixels="True"
|
|
Stretch="Fill"
|
|
StrokeDashArray="1,2"
|
|
StrokeThickness="1"
|
|
X1="0"
|
|
X2="1"
|
|
Margin=".5">
|
|
<Line.Stroke>
|
|
<SolidColorBrush Color="Gray" />
|
|
</Line.Stroke>
|
|
</Line>
|
|
</StackPanel>
|
|
</Border>
|
|
</ControlTemplate>
|
|
|
|
<SolidColorBrush x:Key="MouseOverBorderBrush"
|
|
Color="#FFFFB700" />
|
|
<LinearGradientBrush x:Key="MouseOverBackgroundBrush"
|
|
StartPoint="0,0"
|
|
EndPoint="0,1">
|
|
<GradientStop Offset="0"
|
|
Color="#FFFEFBF4" />
|
|
<GradientStop Offset="0.19"
|
|
Color="#FFFDE7CE" />
|
|
<GradientStop Offset="0.39"
|
|
Color="#FFFDDEB8" />
|
|
<GradientStop Offset="0.39"
|
|
Color="#FFFFCE6B" />
|
|
<GradientStop Offset="0.79"
|
|
Color="#FFFFDE9A" />
|
|
<GradientStop Offset="1"
|
|
Color="#FFFFEBAA" />
|
|
</LinearGradientBrush>
|
|
|
|
<SolidColorBrush x:Key="CheckedBorderBrush"
|
|
Color="#FFC29B29" />
|
|
<LinearGradientBrush x:Key="CheckedBackgroundBrush"
|
|
StartPoint="0,0"
|
|
EndPoint="0,1">
|
|
<GradientStop Offset="0"
|
|
Color="#FFFFDCA0" />
|
|
<GradientStop Offset="0.18"
|
|
Color="#FFFFD692" />
|
|
<GradientStop Offset="0.39"
|
|
Color="#FFFFC45D" />
|
|
<GradientStop Offset="1"
|
|
Color="#FFFFD178" />
|
|
</LinearGradientBrush>
|
|
|
|
<SolidColorBrush x:Key="PressedBorderBrush"
|
|
Color="#FFC29B29" />
|
|
<LinearGradientBrush x:Key="PressedBackgroundBrush"
|
|
StartPoint="0,0"
|
|
EndPoint="0,1">
|
|
<GradientStop Offset="0"
|
|
Color="#FFE3C085" />
|
|
<GradientStop Offset="0.19"
|
|
Color="#FFF4CC89" />
|
|
<GradientStop Offset="0.36"
|
|
Color="#FFF5C777" />
|
|
<GradientStop Offset="0.36"
|
|
Color="#FFF5BB56" />
|
|
<GradientStop Offset="0.79"
|
|
Color="#FFF4CE9A" />
|
|
<GradientStop Offset="1"
|
|
Color="#FFF3E28D" />
|
|
</LinearGradientBrush>
|
|
|
|
<Style x:Key="FormatBarToggleButtonStyle"
|
|
TargetType="{x:Type ToggleButton}">
|
|
<Setter Property="Background"
|
|
Value="Transparent" />
|
|
<Setter Property="BorderBrush"
|
|
Value="Transparent" />
|
|
<Setter Property="BorderThickness"
|
|
Value="1" />
|
|
<Setter Property="FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter Property="Height"
|
|
Value="22" />
|
|
<Setter Property="HorizontalContentAlignment"
|
|
Value="Center" />
|
|
<Setter Property="ToolTipService.InitialShowDelay"
|
|
Value="900" />
|
|
<Setter Property="ToolTipService.ShowDuration"
|
|
Value="20000" />
|
|
<Setter Property="ToolTipService.BetweenShowDelay"
|
|
Value="0" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
|
<Grid SnapsToDevicePixels="True">
|
|
<Border x:Name="OuterBorder"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Background="{TemplateBinding Background}"
|
|
CornerRadius="2" />
|
|
<Border x:Name="MiddleBorder"
|
|
BorderBrush="Transparent"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Background="Transparent"
|
|
CornerRadius="2">
|
|
<Border x:Name="InnerBorder"
|
|
BorderBrush="Transparent"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Background="Transparent"
|
|
CornerRadius="2"
|
|
Padding="{TemplateBinding Padding}">
|
|
<StackPanel x:Name="StackPanel"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
|
|
<ContentPresenter x:Name="Content"
|
|
Content="{TemplateBinding Content}"
|
|
Margin="1"
|
|
RenderOptions.BitmapScalingMode="NearestNeighbor"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
|
|
</StackPanel>
|
|
</Border>
|
|
</Border>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver"
|
|
Value="True">
|
|
<Setter Property="Background"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource MouseOverBackgroundBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource MouseOverBorderBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="InnerBorder"
|
|
Value="#80FFFFFF" />
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsEnabled"
|
|
Value="False">
|
|
<Setter Property="Opacity"
|
|
TargetName="Content"
|
|
Value="0.5" />
|
|
<Setter Property="TextElement.Foreground"
|
|
TargetName="OuterBorder"
|
|
Value="#FF9E9E9E" />
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsChecked"
|
|
Value="True">
|
|
<Setter Property="Background"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource CheckedBackgroundBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource CheckedBorderBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="InnerBorder">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0,1"
|
|
StartPoint="0,0">
|
|
<GradientStop Color="#FFE7CBAD"
|
|
Offset="0" />
|
|
<GradientStop Color="#FFF7D7B5"
|
|
Offset="0.1" />
|
|
<GradientStop Color="#FFFFD38C"
|
|
Offset="0.36" />
|
|
<GradientStop Color="#FFFFC75A"
|
|
Offset="0.36" />
|
|
<GradientStop Color="#FFFFEFA5"
|
|
Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsPressed"
|
|
Value="True">
|
|
<Setter Property="Background"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource PressedBackgroundBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource PressedBorderBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="InnerBorder"
|
|
Value="Transparent" />
|
|
</Trigger>
|
|
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsChecked"
|
|
Value="True" />
|
|
<Condition Property="IsMouseOver"
|
|
Value="True" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter Property="Background"
|
|
TargetName="MiddleBorder">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0,1"
|
|
StartPoint="0,0">
|
|
<GradientStop Color="#40FFFEFE"
|
|
Offset="0" />
|
|
<GradientStop Color="#40FFFEFE"
|
|
Offset="0.39" />
|
|
<GradientStop Color="#20FFCE68"
|
|
Offset="0.39" />
|
|
<GradientStop Color="#20FFCE68"
|
|
Offset="0.69" />
|
|
<GradientStop Color="#10FFFFFF"
|
|
Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</MultiTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="FontColorButtonStyle"
|
|
TargetType="{x:Type ToggleButton}">
|
|
<Setter Property="Background"
|
|
Value="Transparent" />
|
|
<Setter Property="BorderBrush"
|
|
Value="Transparent" />
|
|
<Setter Property="BorderThickness"
|
|
Value="1" />
|
|
<Setter Property="FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter Property="Height"
|
|
Value="22" />
|
|
<Setter Property="HorizontalContentAlignment"
|
|
Value="Center" />
|
|
<Setter Property="ToolTipService.InitialShowDelay"
|
|
Value="900" />
|
|
<Setter Property="ToolTipService.ShowDuration"
|
|
Value="20000" />
|
|
<Setter Property="ToolTipService.BetweenShowDelay"
|
|
Value="0" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
|
<Grid SnapsToDevicePixels="True">
|
|
<Border x:Name="OuterBorder"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="2" />
|
|
<Border x:Name="MiddleBorder"
|
|
BorderBrush="Transparent"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Background="Transparent"
|
|
CornerRadius="2">
|
|
<Border x:Name="InnerBorder"
|
|
BorderBrush="Transparent"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Background="Transparent"
|
|
CornerRadius="2"
|
|
Padding="{TemplateBinding Padding}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid>
|
|
<Image Source="../Images/FontColorPicker16.png"
|
|
Width="16"
|
|
Height="16" >
|
|
</Image>
|
|
<Rectangle Grid.Row="1"
|
|
Height="4"
|
|
Margin="0,12,0,0"
|
|
Fill="{Binding SelectedColor, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorPicker}, Converter={StaticResource ColorToSolidColorBrushConverter}}" />
|
|
</Grid>
|
|
|
|
<Path Grid.Column="1"
|
|
Width="9"
|
|
Height="5"
|
|
Data="{StaticResource DownArrowGeometry}"
|
|
Fill="#FF000000"
|
|
Margin="0,1,0,0" />
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver"
|
|
Value="True">
|
|
<Setter Property="Background"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource MouseOverBackgroundBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource MouseOverBorderBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="InnerBorder"
|
|
Value="#80FFFFFF" />
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsEnabled"
|
|
Value="False">
|
|
<Setter Property="TextElement.Foreground"
|
|
TargetName="OuterBorder"
|
|
Value="#FF9E9E9E" />
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsChecked"
|
|
Value="True">
|
|
<Setter Property="Background"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource CheckedBackgroundBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource CheckedBorderBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="InnerBorder">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0,1"
|
|
StartPoint="0,0">
|
|
<GradientStop Color="#FFE7CBAD"
|
|
Offset="0" />
|
|
<GradientStop Color="#FFF7D7B5"
|
|
Offset="0.1" />
|
|
<GradientStop Color="#FFFFD38C"
|
|
Offset="0.36" />
|
|
<GradientStop Color="#FFFFC75A"
|
|
Offset="0.36" />
|
|
<GradientStop Color="#FFFFEFA5"
|
|
Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsPressed"
|
|
Value="True">
|
|
<Setter Property="Background"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource PressedBackgroundBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource PressedBorderBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="InnerBorder"
|
|
Value="Transparent" />
|
|
</Trigger>
|
|
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsChecked"
|
|
Value="True" />
|
|
<Condition Property="IsMouseOver"
|
|
Value="True" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter Property="Background"
|
|
TargetName="MiddleBorder">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0,1"
|
|
StartPoint="0,0">
|
|
<GradientStop Color="#40FFFEFE"
|
|
Offset="0" />
|
|
<GradientStop Color="#40FFFEFE"
|
|
Offset="0.39" />
|
|
<GradientStop Color="#20FFCE68"
|
|
Offset="0.39" />
|
|
<GradientStop Color="#20FFCE68"
|
|
Offset="0.69" />
|
|
<GradientStop Color="#10FFFFFF"
|
|
Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</MultiTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="FontBackgrounColorButtonStyle"
|
|
TargetType="{x:Type ToggleButton}">
|
|
<Setter Property="Background"
|
|
Value="White" />
|
|
<Setter Property="BorderBrush"
|
|
Value="Transparent" />
|
|
<Setter Property="BorderThickness"
|
|
Value="1" />
|
|
<Setter Property="FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter Property="Height"
|
|
Value="22" />
|
|
<Setter Property="HorizontalContentAlignment"
|
|
Value="Center" />
|
|
<Setter Property="ToolTipService.InitialShowDelay"
|
|
Value="900" />
|
|
<Setter Property="ToolTipService.ShowDuration"
|
|
Value="20000" />
|
|
<Setter Property="ToolTipService.BetweenShowDelay"
|
|
Value="0" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
|
<Grid SnapsToDevicePixels="True">
|
|
<Border x:Name="OuterBorder"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="2" />
|
|
<Border x:Name="MiddleBorder"
|
|
BorderBrush="Transparent"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Background="Transparent"
|
|
CornerRadius="2">
|
|
<Border x:Name="InnerBorder"
|
|
BorderBrush="Transparent"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Background="Transparent"
|
|
CornerRadius="2"
|
|
Padding="{TemplateBinding Padding}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid>
|
|
<Image Source="../Images/TextHighlightColorPicker16.png"
|
|
Width="16"
|
|
Height="16" >
|
|
</Image>
|
|
<Rectangle Grid.Row="1"
|
|
Height="4"
|
|
Margin="0,12,0,0"
|
|
Fill="{Binding SelectedColor, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorPicker}, Converter={StaticResource ColorToSolidColorBrushConverter}}" />
|
|
</Grid>
|
|
|
|
<Path Grid.Column="1"
|
|
Width="9"
|
|
Height="5"
|
|
Data="{StaticResource DownArrowGeometry}"
|
|
Fill="#FF000000"
|
|
Margin="0,1,0,0" />
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver"
|
|
Value="True">
|
|
<Setter Property="Background"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource MouseOverBackgroundBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource MouseOverBorderBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="InnerBorder"
|
|
Value="#80FFFFFF" />
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsEnabled"
|
|
Value="False">
|
|
<Setter Property="TextElement.Foreground"
|
|
TargetName="OuterBorder"
|
|
Value="#FF9E9E9E" />
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsChecked"
|
|
Value="True">
|
|
<Setter Property="Background"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource CheckedBackgroundBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource CheckedBorderBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="InnerBorder">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0,1"
|
|
StartPoint="0,0">
|
|
<GradientStop Color="#FFE7CBAD"
|
|
Offset="0" />
|
|
<GradientStop Color="#FFF7D7B5"
|
|
Offset="0.1" />
|
|
<GradientStop Color="#FFFFD38C"
|
|
Offset="0.36" />
|
|
<GradientStop Color="#FFFFC75A"
|
|
Offset="0.36" />
|
|
<GradientStop Color="#FFFFEFA5"
|
|
Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsPressed"
|
|
Value="True">
|
|
<Setter Property="Background"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource PressedBackgroundBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="OuterBorder"
|
|
Value="{StaticResource PressedBorderBrush}" />
|
|
<Setter Property="BorderBrush"
|
|
TargetName="InnerBorder"
|
|
Value="Transparent" />
|
|
</Trigger>
|
|
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsChecked"
|
|
Value="True" />
|
|
<Condition Property="IsMouseOver"
|
|
Value="True" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter Property="Background"
|
|
TargetName="MiddleBorder">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0,1"
|
|
StartPoint="0,0">
|
|
<GradientStop Color="#40FFFEFE"
|
|
Offset="0" />
|
|
<GradientStop Color="#40FFFEFE"
|
|
Offset="0.39" />
|
|
<GradientStop Color="#20FFCE68"
|
|
Offset="0.39" />
|
|
<GradientStop Color="#20FFCE68"
|
|
Offset="0.69" />
|
|
<GradientStop Color="#10FFFFFF"
|
|
Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</MultiTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Template -->
|
|
<!-- =================================================================== -->
|
|
<ControlTemplate x:Key="richTextBoxFormatBarTemplate"
|
|
TargetType="{x:Type local:RichTextBoxFormatBar}">
|
|
<ControlTemplate.Resources>
|
|
<Style TargetType="{x:Type Separator}"
|
|
BasedOn="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
|
|
</ControlTemplate.Resources>
|
|
<Border CornerRadius="3"
|
|
BorderThickness="1"
|
|
BorderBrush="Gray"
|
|
Background="WhiteSmoke">
|
|
<Grid Margin="5,0,5,5">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Thumb x:Name="_dragWidget"
|
|
Height="10"
|
|
Template="{StaticResource ThumbControlTemplate}" >
|
|
</Thumb>
|
|
|
|
<StackPanel Grid.Row="1">
|
|
<StackPanel Orientation="Horizontal">
|
|
<ComboBox x:Name="_cmbFontFamilies"
|
|
IsEditable="True"
|
|
Width="100"
|
|
ToolTip="Font Family" >
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding}"
|
|
FontFamily="{Binding Converter={StaticResource PrintableFontFamilyConverter}, TargetNullValue=Arial}" />
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
|
|
<ComboBox x:Name="_cmbFontSizes"
|
|
IsEditable="True"
|
|
Width="43"
|
|
ToolTip="Font Size" >
|
|
</ComboBox>
|
|
|
|
<Separator>
|
|
</Separator>
|
|
|
|
<ToggleButton x:Name="_btnBullets"
|
|
Style="{StaticResource FormatBarToggleButtonStyle}"
|
|
Command="EditingCommands.ToggleBullets"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Target}"
|
|
ToolTip="Bullets">
|
|
<Image Source="../Images/Bullets16.png" >
|
|
</Image>
|
|
</ToggleButton>
|
|
|
|
<ToggleButton x:Name="_btnNumbers"
|
|
Style="{StaticResource FormatBarToggleButtonStyle}"
|
|
Command="EditingCommands.ToggleNumbering"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Target}"
|
|
ToolTip="Numbering">
|
|
<Image Source="../Images/Numbering16.png" >
|
|
</Image>
|
|
</ToggleButton>
|
|
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Horizontal"
|
|
Margin="0,3,0,0">
|
|
<ToggleButton x:Name="_btnBold"
|
|
Style="{StaticResource FormatBarToggleButtonStyle}"
|
|
Command="EditingCommands.ToggleBold"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Target}"
|
|
ToolTip="Bold">
|
|
<Image Source="../Images/Bold16.png" >
|
|
</Image>
|
|
</ToggleButton>
|
|
<ToggleButton x:Name="_btnItalic"
|
|
Style="{StaticResource FormatBarToggleButtonStyle}"
|
|
Command="{x:Static EditingCommands.ToggleItalic}"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Target}"
|
|
ToolTip="Italic">
|
|
<Image Source="../Images/Italic16.png" >
|
|
</Image>
|
|
</ToggleButton>
|
|
<ToggleButton x:Name="_btnUnderline"
|
|
Style="{StaticResource FormatBarToggleButtonStyle}"
|
|
Command="{x:Static EditingCommands.ToggleUnderline}"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Target}"
|
|
ToolTip="Underline">
|
|
<Image Source="../Images/Underline16.png" >
|
|
</Image>
|
|
</ToggleButton>
|
|
|
|
<Separator>
|
|
</Separator>
|
|
|
|
<RadioButton x:Name="_btnAlignLeft"
|
|
Style="{StaticResource FormatBarToggleButtonStyle}"
|
|
Command="{x:Static EditingCommands.AlignLeft}"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Target}"
|
|
ToolTip="Align Left">
|
|
<Image Source="../Images/LeftAlign16.png">
|
|
</Image>
|
|
</RadioButton>
|
|
<RadioButton x:Name="_btnAlignCenter"
|
|
Style="{StaticResource FormatBarToggleButtonStyle}"
|
|
Command="{x:Static EditingCommands.AlignCenter}"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Target}"
|
|
ToolTip="Align Center">
|
|
<Image Source="../Images/CenterAlign16.png" >
|
|
</Image>
|
|
</RadioButton>
|
|
<RadioButton x:Name="_btnAlignRight"
|
|
Style="{StaticResource FormatBarToggleButtonStyle}"
|
|
Command="{x:Static EditingCommands.AlignRight}"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Target}"
|
|
ToolTip="Align Right">
|
|
<Image Source="../Images/RightAlign16.png" >
|
|
</Image>
|
|
</RadioButton>
|
|
|
|
<Separator>
|
|
</Separator>
|
|
|
|
<local:ColorPicker x:Name="_cmbFontBackgroundColor"
|
|
BorderThickness="0"
|
|
ButtonStyle="{StaticResource FontBackgrounColorButtonStyle}"
|
|
ToolTip="Text Highlight Color" >
|
|
</local:ColorPicker>
|
|
|
|
<local:ColorPicker x:Name="_cmbFontColor"
|
|
BorderThickness="0"
|
|
ButtonStyle="{StaticResource FontColorButtonStyle}"
|
|
ToolTip="Font Color" >
|
|
</local:ColorPicker>
|
|
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</ControlTemplate>
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Style -->
|
|
<!-- =================================================================== -->
|
|
<Style TargetType="{x:Type local:RichTextBoxFormatBar}">
|
|
<Setter Property="Template"
|
|
Value="{StaticResource richTextBoxFormatBarTemplate}" />
|
|
<Setter Property="Effect">
|
|
<Setter.Value>
|
|
<DropShadowEffect BlurRadius="5"
|
|
Opacity=".25" />
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Background"
|
|
Value="Transparent" />
|
|
<Setter Property="IsTabStop"
|
|
Value="false" />
|
|
</Style>
|
|
|
|
</ResourceDictionary>
|
|
|