@ -1,9 +1,11 @@ |
|||
<Window x:Class="WPFToolkit.Extended.Samples.MainWindow" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="MainWindow" Height="350" Width="525" > |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
xmlns:local="clr-namespace:WPFToolkit.Extended.Samples" |
|||
Title="MainWindow" Height="600" Width="800" WindowStartupLocation="CenterScreen" ForceCursor="True"> |
|||
|
|||
<Grid> |
|||
|
|||
|
|||
</Grid> |
|||
</Window> |
|||
|
|||
@ -1,9 +1,9 @@ |
|||
<Window x:Class="WPFToolkit.Extended.Examples.Window1" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:extToolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="Window1" Height="300" Width="300"> |
|||
<Grid> |
|||
|
|||
|
|||
</Grid> |
|||
</Window> |
|||
|
|||
@ -0,0 +1,144 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="clr-namespace:System;assembly=mscorlib" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls"> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- BusyIndicator --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<Style TargetType="{x:Type local:BusyIndicator}"> |
|||
<Setter Property="BusyContent" Value="Please wait..."/> |
|||
<Setter Property="IsTabStop" Value="False"/> |
|||
<Setter Property="Focusable" Value="False" /> |
|||
<Setter Property="OverlayStyle"> |
|||
<Setter.Value> |
|||
<Style TargetType="Rectangle"> |
|||
<Setter Property="Fill" Value="White"/> |
|||
<Setter Property="Opacity" Value="0.5"/> |
|||
</Style> |
|||
</Setter.Value> |
|||
</Setter> |
|||
<Setter Property="ProgressBarStyle"> |
|||
<Setter.Value> |
|||
<Style TargetType="ProgressBar"> |
|||
<Setter Property="IsIndeterminate" Value="True"/> |
|||
<Setter Property="Height" Value="15"/> |
|||
<Setter Property="Margin" Value="8,0,8,8"/> |
|||
</Style> |
|||
</Setter.Value> |
|||
</Setter> |
|||
<Setter Property="DisplayAfter" Value="00:00:00.1"/> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch"/> |
|||
<Setter Property="VerticalAlignment" Value="Stretch"/> |
|||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/> |
|||
<Setter Property="VerticalContentAlignment" Value="Stretch"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:BusyIndicator}"> |
|||
<Grid> |
|||
<VisualStateManager.VisualStateGroups> |
|||
<VisualStateGroup x:Name="VisibilityStates"> |
|||
<VisualState x:Name="Hidden"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="busycontent" Storyboard.TargetProperty="(UIElement.Visibility)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Collapsed</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="overlay" Storyboard.TargetProperty="(UIElement.Visibility)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Collapsed</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
<VisualState x:Name="Visible"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="busycontent" Storyboard.TargetProperty="(UIElement.Visibility)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="overlay" Storyboard.TargetProperty="(UIElement.Visibility)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
<VisualStateGroup x:Name="BusyStatusStates"> |
|||
<VisualState x:Name="Idle"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="content" Storyboard.TargetProperty="(Control.IsEnabled)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<sys:Boolean>True</sys:Boolean> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
<VisualState x:Name="Busy"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="content" Storyboard.TargetProperty="(Control.IsEnabled)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<sys:Boolean>False</sys:Boolean> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateManager.VisualStateGroups> |
|||
<ContentControl x:Name="content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsTabStop="False" Focusable="False" /> |
|||
<Rectangle x:Name="overlay" Style="{TemplateBinding OverlayStyle}"/> |
|||
<ContentPresenter x:Name="busycontent"> |
|||
<ContentPresenter.Content> |
|||
<Grid HorizontalAlignment="Center" VerticalAlignment="Center"> |
|||
<Border Background="White" BorderThickness="1" CornerRadius="2"> |
|||
<Border.BorderBrush> |
|||
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> |
|||
<GradientStop Color="#FFA3AEB9" Offset="0"/> |
|||
<GradientStop Color="#FF8399A9" Offset="0.375"/> |
|||
<GradientStop Color="#FF718597" Offset="0.375"/> |
|||
<GradientStop Color="#FF617584" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
</Border.BorderBrush> |
|||
<Border CornerRadius="1.5" Margin="1"> |
|||
<Border.Background> |
|||
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> |
|||
<GradientStop Color="#FFF6F8F9" Offset="0.02"/> |
|||
<GradientStop Color="#FFB8B8B8" Offset="0.996"/> |
|||
</LinearGradientBrush> |
|||
</Border.Background> |
|||
<Grid MinWidth="150"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition/> |
|||
<RowDefinition Height="Auto"/> |
|||
</Grid.RowDefinitions> |
|||
<ContentControl Content="{TemplateBinding BusyContent}" ContentTemplate="{TemplateBinding BusyContentTemplate}" Margin="8"/> |
|||
<ProgressBar Grid.Row="1" Style="{TemplateBinding ProgressBarStyle}"/> |
|||
</Grid> |
|||
</Border> |
|||
</Border> |
|||
</Grid> |
|||
</ContentPresenter.Content> |
|||
</ContentPresenter> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,90 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" |
|||
xmlns:chrome="clr-namespace:Microsoft.Windows.Controls.Chromes"> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- ButtonSpinner --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<SolidColorBrush x:Key="SpinButtonGlyphNormalForegroundFillKey" Color="#FF000000" /> |
|||
|
|||
<DataTemplate x:Key="IncreaseGlyph"> |
|||
<Path Width="7" Height="4" Data="M 0,3 C0,3 0,4 0,4 0,4 3,4 3,4 3,4 3,3 3,3 3,3 4,3 4,3 4,3 4,4 4,4 4,4 7,4 7,4 7,4 7,3 7,3 7,3 6,3 6,3 6,3 6,2 6,2 6,2 5,2 5,2 5,2 5,1 5,1 5,1 4,1 4,1 4,1 4,0 4,0 4,0 3,0 3,0 3,0 3,1 3,1 3,1 2,1 2,1 2,1 2,2 2,2 2,2 1,2 1,2 1,2 1,3 1,3 1,3 0,3 0,3 z" Fill="{StaticResource SpinButtonGlyphNormalForegroundFillKey}"/> |
|||
</DataTemplate> |
|||
|
|||
<DataTemplate x:Key="DecreaseGlyph"> |
|||
<Path Width="7" Height="4" Data="M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z" Fill="{StaticResource SpinButtonGlyphNormalForegroundFillKey}"/> |
|||
</DataTemplate> |
|||
|
|||
<Style TargetType="{x:Type local:ButtonSpinner}"> |
|||
<Setter Property="Focusable" Value="False" /> |
|||
<Setter Property="IsTabStop" Value="True" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center" /> |
|||
<Setter Property="BorderBrush"> |
|||
<Setter.Value> |
|||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> |
|||
<GradientStop Color="#FFA3AEB9" Offset="0" /> |
|||
<GradientStop Color="#FF8399A9" Offset="0.375" /> |
|||
<GradientStop Color="#FF718597" Offset="0.375" /> |
|||
<GradientStop Color="#FF617584" Offset="1" /> |
|||
</LinearGradientBrush> |
|||
</Setter.Value> |
|||
</Setter> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:ButtonSpinner}"> |
|||
<Grid> |
|||
<Border x:Name="ElementContainer" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"> |
|||
<DockPanel Focusable="False"> |
|||
<Grid DockPanel.Dock="Right"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="*" /> |
|||
<RowDefinition Height="1" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
<RepeatButton x:Name="IncreaseButton" SnapsToDevicePixels="True" Grid.Row="0" ClickMode="Press" IsTabStop="{Binding IsTabStop, RelativeSource={RelativeSource TemplatedParent}}"> |
|||
<RepeatButton.Template> |
|||
<ControlTemplate TargetType="RepeatButton"> |
|||
<ContentPresenter /> |
|||
</ControlTemplate> |
|||
</RepeatButton.Template> |
|||
<Grid> |
|||
<chrome:ButtonChrome CornerRadius="0" |
|||
RenderEnabled="{TemplateBinding IsEnabled}" |
|||
RenderMouseOver="{Binding IsMouseOver, ElementName=IncreaseButton}" |
|||
RenderPressed="{Binding IsPressed, ElementName=IncreaseButton}"/> |
|||
<ContentControl ContentTemplate="{StaticResource IncreaseGlyph}" Margin="5,1" Focusable="False" /> |
|||
</Grid> |
|||
</RepeatButton> |
|||
<RepeatButton x:Name="DecreaseButton" SnapsToDevicePixels="True" Grid.Row="2" ClickMode="Press" IsTabStop="{Binding IsTabStop, RelativeSource={RelativeSource TemplatedParent}}" > |
|||
<RepeatButton.Template> |
|||
<ControlTemplate TargetType="RepeatButton"> |
|||
<ContentPresenter /> |
|||
</ControlTemplate> |
|||
</RepeatButton.Template> |
|||
<Grid> |
|||
<chrome:ButtonChrome CornerRadius="0" |
|||
RenderEnabled="{TemplateBinding IsEnabled}" |
|||
RenderMouseOver="{Binding IsMouseOver, ElementName=DecreaseButton}" |
|||
RenderPressed="{Binding IsPressed, ElementName=DecreaseButton}"/> |
|||
<ContentControl ContentTemplate="{StaticResource DecreaseGlyph}" Margin="5,1" Focusable="False" /> |
|||
</Grid> |
|||
</RepeatButton> |
|||
</Grid> |
|||
<ContentControl x:Name="presentationSite" Focusable="False" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding Content}" /> |
|||
</DockPanel> |
|||
</Border> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,234 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls"> |
|||
|
|||
<LinearGradientBrush x:Key="WindowDarkBrush" EndPoint="0.5,1" StartPoint="0.5,0"> |
|||
<GradientStop Color="#FFA3AEB9" Offset="0"/> |
|||
<GradientStop Color="#FF8399A9" Offset="0.375"/> |
|||
<GradientStop Color="#FF718597" Offset="0.375"/> |
|||
<GradientStop Color="#FF617584" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="WindowBackgroundBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFffffff"/> |
|||
<GradientStop Offset="0.479" Color="#FFf4f5f6"/> |
|||
<GradientStop Offset="1" Color="#FFd0d6db"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="WindowButtonHoverBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFb5bdc8"/> |
|||
<GradientStop Offset="0.370" Color="#FF8399a9"/> |
|||
<GradientStop Offset="0.370" Color="#FF718597"/> |
|||
<GradientStop Offset="0.906" Color="#FFb9c1ca"/> |
|||
<GradientStop Offset="1" Color="#FFb9c1ca"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="WindowButtonPressedBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FF6b7c8d"/> |
|||
<GradientStop Offset="0.370" Color="#FF4d606f"/> |
|||
<GradientStop Offset="0.370" Color="#FF465460"/> |
|||
<GradientStop Offset="0.906" Color="#FF262d33"/> |
|||
<GradientStop Offset="1" Color="#FF262d33"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<Style x:Key="WindowCloseButtonStyle" TargetType="Button"> |
|||
<Setter Property="Foreground" Value="#FF000000"/> |
|||
<Setter Property="Padding" Value="3"/> |
|||
<Setter Property="BorderThickness" Value="1"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="Button"> |
|||
<Grid> |
|||
<VisualStateManager.VisualStateGroups> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal"/> |
|||
<VisualState x:Name="MouseOver"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource WindowButtonHoverBrush}"></DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
<VisualState x:Name="Pressed"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource WindowButtonPressedBrush}"></DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateManager.VisualStateGroups> |
|||
<Border x:Name="Background" CornerRadius="0,0,2,0" Background="{StaticResource WindowDarkBrush}"> |
|||
<Border Margin="1,0,1,1" BorderBrush="#59FFFFFF" BorderThickness="1" CornerRadius="0,0,1,0"/> |
|||
</Border> |
|||
<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/> |
|||
<Path x:Name="path" |
|||
Height="6" |
|||
Width="7" |
|||
Stretch="Fill" |
|||
Opacity="1" |
|||
Data="M 2,6 C2,6 3,6 3,6 3,6 3,5 3,5 3,5 4,5 4,5 4,5 4,6 4,6 4,6 5,6 5,6 5,6 7,6 7,6 7,6 7,5 7,5 7,5 6,5 6,5 6,5 6,4 6,4 6,4 5,4 5,4 5,4 5,2 5,2 5,2 6,2 6,2 6,2 6,1 6,1 6,1 7,1 7,1 7,1 7,0 7,0 7,0 5,0 5,0 5,0 4,0 4,0 4,0 4,1 4,1 4,1 3,1 3,1 3,1 3,0 3,0 3,0 2,0 2,0 2,0 0,0 0,0 0,0 0,1 0,1 0,1 1,1 1,1 1,1 1,2 1,2 1,2 2,2 2,2 2,2 2,4 2,4 2,4 1,4 1,4 1,4 1,5 1,5 1,5 0,5 0,5 0,5 0,6 0,6 0,6 2,6 2,6 z" |
|||
Fill="White" Margin="0,0,0,1" Visibility="Collapsed" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- ChildWindow --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<SolidColorBrush x:Key="ChildWindowMainBrushColor" Color="#FF3C688D"/> |
|||
<LinearGradientBrush x:Key="BorderBrush" EndPoint="0.5,1" StartPoint="0.5,0"> |
|||
<GradientStop Color="#7FFFFFFF" Offset="0.05"/> |
|||
<GradientStop Color="#B2FFFFFF" Offset="0.07"/> |
|||
<GradientStop Color="#00FFFFFF" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<Style TargetType="{x:Type local:ChildWindow}"> |
|||
<Setter Property="Background" Value="#FFFFFFFF"/> |
|||
<Setter Property="BorderBrush" Value="{StaticResource WindowDarkBrush}" /> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="CaptionForeground" Value="#FF000000" /> |
|||
<Setter Property="CloseButtonStyle" Value="{StaticResource WindowCloseButtonStyle}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
|||
<Setter Property="IsTabStop" Value="False" /> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Top" /> |
|||
<Setter Property="WindowBorderBrush" Value="{StaticResource WindowDarkBrush}" /> |
|||
<Setter Property="WindowBackground" Value="{StaticResource WindowBackgroundBrush}" /> |
|||
<Setter Property="WindowOpacity" Value="1.0" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:ChildWindow}"> |
|||
<Grid x:Name="Root"> |
|||
<Grid.Resources> |
|||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> |
|||
<Style x:Key="FocusVisualStyle" TargetType="Control"> |
|||
<Setter Property="BorderBrush" Value="Black"/> |
|||
<Setter Property="Background" Value="Transparent"/> |
|||
<Setter Property="Margin" Value="-1"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate> |
|||
<Rectangle Stroke="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}" Margin="{TemplateBinding Margin}" StrokeDashArray="4 3" StrokeThickness="0.5"> |
|||
<Rectangle.RenderTransform> |
|||
<TranslateTransform X="{Binding Left}" Y="{Binding Top}"/> |
|||
</Rectangle.RenderTransform> |
|||
</Rectangle> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
</Grid.Resources> |
|||
|
|||
<!--VisualStateManager--> |
|||
<VisualStateManager.VisualStateGroups> |
|||
<VisualStateGroup x:Name="WindowStatesGroup"> |
|||
<VisualState x:Name="Closed"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Visibility" Duration="0"> |
|||
<DiscreteObjectKeyFrame KeyTime="0"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Collapsed</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
<VisualState x:Name="Open"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Visibility" Duration="0"> |
|||
<DiscreteObjectKeyFrame KeyTime="0"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateManager.VisualStateGroups> |
|||
|
|||
<Grid x:Name="PART_WindowRoot" HorizontalAlignment="Left" VerticalAlignment="Top" MinWidth="{TemplateBinding MinWidth}" MinHeight="{TemplateBinding MinHeight}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" > |
|||
<Grid.RenderTransform> |
|||
<TransformGroup> |
|||
<ScaleTransform /> |
|||
<SkewTransform /> |
|||
<RotateTransform /> |
|||
<TranslateTransform /> |
|||
</TransformGroup> |
|||
</Grid.RenderTransform> |
|||
|
|||
<!-- Borders --> |
|||
<Grid x:Name="WindowGrid"> |
|||
<Border BorderBrush="{TemplateBinding WindowBorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5,5,0,0" Opacity="{TemplateBinding WindowOpacity}"/> |
|||
<Grid Margin="0" Background="{x:Null}"> |
|||
<Border x:Name="WindowBorder" Margin="1,1,1,1" Background="{TemplateBinding WindowBackground}" CornerRadius="4,4,0,0" Opacity="{TemplateBinding WindowOpacity}"/> |
|||
<Border BorderBrush="White" BorderThickness="1" CornerRadius="4,4,0,0" Margin="1" Opacity="0.7"/> |
|||
</Grid> |
|||
</Grid> |
|||
|
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" MinHeight="26"/> |
|||
<RowDefinition /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<!-- Content Border --> |
|||
<Grid Margin="6,0,6,6" x:Name="ContentGrid" Grid.Row="1"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition/> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Border BorderBrush="#FFFFFFFF" BorderThickness="1" CornerRadius="1"/> |
|||
<Border Margin="1" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0.1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"> |
|||
|
|||
<ContentPresenter x:Name="Content" Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
</Border> |
|||
</Grid> |
|||
|
|||
<!-- Header --> |
|||
<Border x:Name="PART_DragWidget" Background="Transparent" Grid.Column="1" CornerRadius="5,5,0,0" Margin="1,1,1,0"> |
|||
<Grid> |
|||
<Grid x:Name="CaptionHeader" Margin="1,1,105,0" VerticalAlignment="Center"> |
|||
<!-- Caption --> |
|||
<ContentControl x:Name="Caption" Margin="5,0,0,0" IsTabStop="False" HorizontalAlignment="Stretch" |
|||
Content="{TemplateBinding Caption}" |
|||
Foreground="{TemplateBinding CaptionForeground}"/> |
|||
|
|||
</Grid> |
|||
</Grid> |
|||
</Border> |
|||
</Grid> |
|||
|
|||
<!-- Buttons --> |
|||
<Border BorderBrush="#A5FFFFFF" BorderThickness="1,0,1,1" CornerRadius="0,0,3,3" VerticalAlignment="Top" Margin="0,1,7,0" HorizontalAlignment="Right"> |
|||
<Button x:Name="PART_CloseButton" Style="{TemplateBinding CloseButtonStyle}" Visibility="{TemplateBinding CloseButtonVisibility}" Height="17" Width="43" IsTabStop="False"> |
|||
<Path Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" Width="12" Fill="#E4FFFFFF" Stretch="Fill" Stroke="#FF535666" |
|||
Data="M0.5,0.5 L4.5178828,0.5 L6.0620003,3.125 L7.4936447,0.5 L11.5,0.5 L11.5,1.5476431 L8.7425003,6.1201854 L11.5,10.359666 L11.5,11.5 L7.4941902,11.5 L6.0620003,8.8740005 L4.5172949,11.5 L0.5,11.5 L0.5,10.43379 L3.3059995,6.1201582 L0.5,1.4676378 L0.5,0.5 z"/> |
|||
</Button> |
|||
</Border> |
|||
</Grid> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,266 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:chrome="clr-namespace:Microsoft.Windows.Controls.Chromes" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" > |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- ButtonChrome --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<CornerRadius x:Key="ControlOuterBorderCornerRadius">2.75</CornerRadius> |
|||
<CornerRadius x:Key="ControlInnerBorderCornerRadius">1.75</CornerRadius> |
|||
|
|||
<!-- Normal --> |
|||
<SolidColorBrush x:Key="ControlOuterBorder_Normal" Color="#FF707070" /> |
|||
<LinearGradientBrush x:Key="ControlInnerBorder_Normal" EndPoint="0,1" StartPoint="0,0"> |
|||
<GradientStop Color="#FAFFFFFF" Offset="0"/> |
|||
<GradientStop Color="#85FFFFFF" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
<LinearGradientBrush x:Key="ControlBackground_Normal" EndPoint="0,1" StartPoint="0,0"> |
|||
<GradientStop Color="#F3F3F3" Offset="0"/> |
|||
<GradientStop Color="#EBEBEB" Offset="0.5"/> |
|||
<GradientStop Color="#DDDDDD" Offset="0.5"/> |
|||
<GradientStop Color="#CDCDCD" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<!--Mouse Over--> |
|||
<SolidColorBrush x:Key="ControlOuterBorder_MouseOver" Color="#3C7FB1" /> |
|||
<LinearGradientBrush x:Key="ControlInnerBorder_MouseOver" EndPoint="0,1" StartPoint="0,0"> |
|||
<GradientStop Color="#FAFFFFFF" Offset="0"/> |
|||
<GradientStop Color="#85FFFFFF" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
<LinearGradientBrush x:Key="ControlBackground_MouseOver" EndPoint="0,1" StartPoint="0,0"> |
|||
<GradientStop Color="#FFEAF6FD" Offset="0"/> |
|||
<GradientStop Color="#FFD9F0FC" Offset="0.50"/> |
|||
<GradientStop Color="#FFBEE6FD" Offset="0.50"/> |
|||
<GradientStop Color="#FFA7D9F5" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<!-- Pressed --> |
|||
<SolidColorBrush x:Key="ControlOuterBorder_Pressed" Color="#2C628B" /> |
|||
<LinearGradientBrush x:Key="ControlInnerBorder_Pressed" EndPoint="0,1" StartPoint="0,0"> |
|||
<GradientStop Color="#FAFFFFFF" Offset="0"/> |
|||
<GradientStop Color="#85FFFFFF" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
<LinearGradientBrush x:Key="ControlBackground_Pressed" EndPoint="0,1" StartPoint="0,0"> |
|||
<GradientStop Color="#C2E4F6" Offset="0.5"/> |
|||
<GradientStop Color="#ABDAF3" Offset="0.5"/> |
|||
<GradientStop Color="#90CBEB" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<!-- Focused --> |
|||
<SolidColorBrush x:Key="ControlOuterBorder_Focused" Color="#FF707070" /> |
|||
<SolidColorBrush x:Key="ControlInnerBorder_Focused" Color="#F900CCFF" /> |
|||
<LinearGradientBrush x:Key="ControlBackground_Focused" EndPoint="0,1" StartPoint="0,0"> |
|||
<GradientStop Color="#FFEAF6FD" Offset="0"/> |
|||
<GradientStop Color="#FFD9F0FC" Offset="0.50"/> |
|||
<GradientStop Color="#FFBEE6FD" Offset="0.50"/> |
|||
<GradientStop Color="#FFA7D9F5" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<!-- Disabled --> |
|||
<SolidColorBrush x:Key="ControlOuterBorder_Disabled" Color="#ADB2B5" /> |
|||
<LinearGradientBrush x:Key="ControlInnerBorder_Disabled" EndPoint="0,1" StartPoint="0,0"> |
|||
<GradientStop Color="#FAFFFFFF" Offset="0"/> |
|||
<GradientStop Color="#85FFFFFF" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
<SolidColorBrush x:Key="ControlBackground_Disabled" Color="#F4F4F4" /> |
|||
|
|||
<Style TargetType="{x:Type chrome:ButtonChrome}"> |
|||
<Setter Property="IsTabStop" Value="False" /> |
|||
<Setter Property="SnapsToDevicePixels" Value="True" /> |
|||
<Setter Property="FocusVisualStyle" Value="{x:Null}" /> |
|||
<Setter Property="Background" Value="{StaticResource ControlBackground_Normal}" /> |
|||
<Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}" /> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="CornerRadius" Value="{StaticResource ControlOuterBorderCornerRadius}" /> |
|||
<Setter Property="InnerCornerRadius" Value="{StaticResource ControlInnerBorderCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type chrome:ButtonChrome}"> |
|||
<Grid> |
|||
|
|||
<Border x:Name="OuterBorder" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"> |
|||
<Border x:Name="InnerBorder" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding InnerCornerRadius}" BorderBrush="{StaticResource ControlInnerBorder_Normal}" /> |
|||
</Border> |
|||
|
|||
<Border x:Name="MouseOverVisual" Opacity="0" Visibility="Collapsed" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{StaticResource ControlOuterBorder_MouseOver}" Background="{StaticResource ControlBackground_MouseOver}"> |
|||
<Border x:Name="MouseOverInnerVisual" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding InnerCornerRadius}" BorderBrush="{StaticResource ControlInnerBorder_MouseOver}" /> |
|||
</Border> |
|||
<Border x:Name="PressedVisual" Opacity="0" Visibility="Collapsed" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{StaticResource ControlOuterBorder_Pressed}" Background="{StaticResource ControlBackground_Pressed}"> |
|||
<Border x:Name="PressedInnerVisual" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding InnerCornerRadius}" BorderBrush="{StaticResource ControlInnerBorder_Pressed}" /> |
|||
</Border> |
|||
|
|||
<Border x:Name="FocusVisual" Opacity="0" Visibility="Collapsed" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{StaticResource ControlOuterBorder_Focused}" Background="{StaticResource ControlBackground_Focused}"> |
|||
<Border x:Name="FocusInnerVisual" BorderThickness="1" CornerRadius="{TemplateBinding InnerCornerRadius}" BorderBrush="{StaticResource ControlInnerBorder_Focused}" /> |
|||
</Border> |
|||
|
|||
</Grid> |
|||
<ControlTemplate.Triggers> |
|||
|
|||
<!-- If button is disabled, not checked, and is rendered normal --> |
|||
<MultiTrigger> |
|||
<MultiTrigger.Conditions> |
|||
<Condition Property="RenderEnabled" Value="False" /> |
|||
<Condition Property="RenderChecked" Value="False" /> |
|||
</MultiTrigger.Conditions> |
|||
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Disabled}" /> |
|||
<Setter TargetName="InnerBorder" Property="BorderBrush" Value="{StaticResource ControlInnerBorder_Disabled}" /> |
|||
<Setter TargetName="OuterBorder" Property="Background" Value="{StaticResource ControlBackground_Disabled}" /> |
|||
</MultiTrigger> |
|||
|
|||
<!-- if button is enabled and pressed --> |
|||
<MultiTrigger> |
|||
<MultiTrigger.Conditions> |
|||
<Condition Property="RenderEnabled" Value="True" /> |
|||
<Condition Property="RenderPressed" Value="True" /> |
|||
</MultiTrigger.Conditions> |
|||
<MultiTrigger.EnterActions> |
|||
<BeginStoryboard> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedVisual" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedVisual" Storyboard.TargetProperty="Opacity"> |
|||
<LinearDoubleKeyFrame KeyTime="00:00:00.050" Value="1" /> |
|||
</DoubleAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</BeginStoryboard> |
|||
</MultiTrigger.EnterActions> |
|||
<MultiTrigger.ExitActions> |
|||
<BeginStoryboard> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedVisual" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00.115"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Collapsed</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedVisual" Storyboard.TargetProperty="Opacity"> |
|||
<LinearDoubleKeyFrame KeyTime="00:00:00.115" Value="0" /> |
|||
</DoubleAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</BeginStoryboard> |
|||
</MultiTrigger.ExitActions> |
|||
</MultiTrigger> |
|||
|
|||
<!-- if button is enabled, is not checked, the mouse is over, and not pressed --> |
|||
<MultiTrigger> |
|||
<MultiTrigger.Conditions> |
|||
<Condition Property="RenderEnabled" Value="True" /> |
|||
<Condition Property="RenderChecked" Value="False" /> |
|||
<Condition Property="RenderMouseOver" Value="True" /> |
|||
<Condition Property="RenderPressed" Value="False" /> |
|||
</MultiTrigger.Conditions> |
|||
<MultiTrigger.EnterActions> |
|||
<BeginStoryboard> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Opacity"> |
|||
<LinearDoubleKeyFrame KeyTime="00:00:00.115" Value="1" /> |
|||
</DoubleAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</BeginStoryboard> |
|||
</MultiTrigger.EnterActions> |
|||
<MultiTrigger.ExitActions> |
|||
<BeginStoryboard> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00.150"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Collapsed</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Opacity"> |
|||
<LinearDoubleKeyFrame KeyTime="00:00:00.150" Value="0" /> |
|||
</DoubleAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</BeginStoryboard> |
|||
</MultiTrigger.ExitActions> |
|||
</MultiTrigger> |
|||
|
|||
<!-- if button is enabled, checked, he mouse is not over, and it is not pressed --> |
|||
<MultiTrigger> |
|||
<MultiTrigger.Conditions> |
|||
<Condition Property="RenderEnabled" Value="True" /> |
|||
<Condition Property="RenderChecked" Value="True" /> |
|||
<Condition Property="RenderMouseOver" Value="False" /> |
|||
<Condition Property="RenderPressed" Value="False" /> |
|||
</MultiTrigger.Conditions> |
|||
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Pressed}" /> |
|||
<Setter TargetName="InnerBorder" Property="BorderBrush" Value="{StaticResource ControlInnerBorder_Pressed}" /> |
|||
<Setter TargetName="OuterBorder" Property="Background" Value="{StaticResource ControlBackground_Pressed}" /> |
|||
</MultiTrigger> |
|||
|
|||
<!-- if button is focused, is enabled, not pressed, and the mouse is not over --> |
|||
<MultiTrigger> |
|||
<MultiTrigger.Conditions> |
|||
<Condition Property="RenderFocused" Value="True" /> |
|||
<Condition Property="RenderEnabled" Value="True" /> |
|||
<Condition Property="RenderPressed" Value="False" /> |
|||
<Condition Property="RenderMouseOver" Value="False" /> |
|||
</MultiTrigger.Conditions> |
|||
<MultiTrigger.EnterActions> |
|||
<BeginStoryboard> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity"> |
|||
<LinearDoubleKeyFrame KeyTime="00:00:00.25" Value="1" /> |
|||
</DoubleAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</BeginStoryboard> |
|||
</MultiTrigger.EnterActions> |
|||
<MultiTrigger.ExitActions> |
|||
<BeginStoryboard> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00.115"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Collapsed</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity"> |
|||
<LinearDoubleKeyFrame KeyTime="00:00:00.115" Value="0" /> |
|||
</DoubleAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</BeginStoryboard> |
|||
</MultiTrigger.ExitActions> |
|||
</MultiTrigger> |
|||
|
|||
<!-- if not rendered normally --> |
|||
<MultiTrigger> |
|||
<MultiTrigger.Conditions> |
|||
<Condition Property="RenderNormal" Value="False" /> |
|||
<Condition Property="RenderChecked" Value="False" /> |
|||
</MultiTrigger.Conditions> |
|||
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="Transparent" /> |
|||
<Setter TargetName="InnerBorder" Property="BorderBrush" Value="{x:Null}" /> |
|||
<Setter TargetName="OuterBorder" Property="Background" Value="Transparent" /> |
|||
</MultiTrigger> |
|||
|
|||
</ControlTemplate.Triggers> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,346 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" |
|||
xmlns:coreConverters="clr-namespace:Microsoft.Windows.Controls.Core.Converters"> |
|||
|
|||
<coreConverters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" /> |
|||
|
|||
<LinearGradientBrush x:Key="ColorPickerDarkBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0"> |
|||
<GradientStop Color="#FFA3AEB9" Offset="0"/> |
|||
<GradientStop Color="#FF8399A9" Offset="0.375"/> |
|||
<GradientStop Color="#FF718597" Offset="0.375"/> |
|||
<GradientStop Color="#FF617584" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="ColorCanvasBackgroundBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFffffff"/> |
|||
<GradientStop Offset="1" Color="#FFE8EBED"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<DrawingBrush x:Key="CheckerBrush" Viewport="0,0,10,10" ViewportUnits="Absolute" TileMode="Tile"> |
|||
<DrawingBrush.Drawing> |
|||
<DrawingGroup> |
|||
<GeometryDrawing Brush="White"> |
|||
<GeometryDrawing.Geometry> |
|||
<RectangleGeometry Rect="0,0 100,100" /> |
|||
</GeometryDrawing.Geometry> |
|||
</GeometryDrawing> |
|||
<GeometryDrawing Brush="LightGray"> |
|||
<GeometryDrawing.Geometry> |
|||
<GeometryGroup> |
|||
<RectangleGeometry Rect="0,0 50,50" /> |
|||
<RectangleGeometry Rect="50,50 50,50" /> |
|||
</GeometryGroup> |
|||
</GeometryDrawing.Geometry> |
|||
</GeometryDrawing> |
|||
</DrawingGroup> |
|||
</DrawingBrush.Drawing> |
|||
</DrawingBrush> |
|||
|
|||
<SolidColorBrush x:Key="HorizontalSliderTrackNormalBackground" Color="#FFE7EAEA"/> |
|||
|
|||
<LinearGradientBrush x:Key="HorizontalSliderTrackNormalBorder" EndPoint="0,1" StartPoint="0,0"> |
|||
<GradientStop Color="#FFAEB1AF" Offset="0.1"/> |
|||
<GradientStop Color="White" Offset=".9"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="ThumbStroke" EndPoint="0.5,1" StartPoint="0.5,0"> |
|||
<GradientStop Color="#FFA3AEB9" Offset="0"/> |
|||
<GradientStop Color="#FF8399A9" Offset="0.375"/> |
|||
<GradientStop Color="#FF718597" Offset="0.375"/> |
|||
<GradientStop Color="#FF617584" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="ThumbFill" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFfefefe"/> |
|||
<GradientStop Offset="0.5" Color="#FFeff1f2"/> |
|||
<GradientStop Offset="1" Color="#FFd0d6db"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<SolidColorBrush x:Key="ThumbMouseOver" Color="#FFE5F2F6"/> |
|||
|
|||
<Style x:Key="ColorCanvasTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Style.Triggers> |
|||
<Trigger Property="IsFocused" Value="False"> |
|||
<Setter Property="BorderBrush" Value="Transparent" /> |
|||
</Trigger> |
|||
</Style.Triggers> |
|||
</Style> |
|||
|
|||
<Style x:Key="SliderRepeatButtonStyle" |
|||
TargetType="{x:Type RepeatButton}"> |
|||
<Setter Property="OverridesDefaultStyle" Value="true"/> |
|||
<Setter Property="IsTabStop" Value="false"/> |
|||
<Setter Property="Focusable" Value="false"/> |
|||
<Setter Property="Background" Value="Transparent"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type RepeatButton}"> |
|||
<Border Background="{TemplateBinding Background}"/> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style x:Key="CustomThumbForSlider" TargetType="{x:Type Thumb}"> |
|||
<Setter Property="OverridesDefaultStyle" Value="True"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type Thumb}"> |
|||
<Rectangle x:Name="_thumb" Fill="{StaticResource ThumbFill}" Stroke="{StaticResource ThumbStroke}" Height="14" Width="8" RadiusX="1" RadiusY="1"/> |
|||
<ControlTemplate.Triggers> |
|||
<Trigger Property="IsMouseOver" Value="True"> |
|||
<Setter TargetName="_thumb" Property="Rectangle.Fill" Value="{StaticResource ThumbMouseOver}" /> |
|||
</Trigger> |
|||
</ControlTemplate.Triggers> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style x:Key="VerticalSlideThumbStyle" TargetType="{x:Type Thumb}"> |
|||
<Setter Property="Focusable" Value="false"/> |
|||
<Setter Property="OverridesDefaultStyle" Value="true"/> |
|||
<Setter Property="Height" Value="12"/> |
|||
<Setter Property="Width" Value="11"/> |
|||
<Setter Property="Foreground" Value="Gray"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type Thumb}"> |
|||
<Canvas SnapsToDevicePixels="true"> |
|||
<Path x:Name="LeftArrow" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FF000000" Data="F1 M 276.761,316L 262.619,307.835L 262.619,324.165L 276.761,316 Z " RenderTransformOrigin="0.5,0.5" Width="6" Height="8" > |
|||
<Path.RenderTransform> |
|||
<TransformGroup> |
|||
<ScaleTransform/> |
|||
<SkewTransform/> |
|||
<RotateTransform /> |
|||
<TranslateTransform Y="6" X="-3"/> |
|||
</TransformGroup> |
|||
</Path.RenderTransform> |
|||
</Path> |
|||
<Path x:Name="RightArrow" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FF000000" Data="F1 M 276.761,316L 262.619,307.835L 262.619,324.165L 276.761,316 Z " RenderTransformOrigin="0.5,0.5" Width="6" Height="8" > |
|||
<Path.RenderTransform> |
|||
<TransformGroup> |
|||
<ScaleTransform/> |
|||
<SkewTransform/> |
|||
<RotateTransform Angle="-180"/> |
|||
<TranslateTransform Y="6" X="8"/> |
|||
</TransformGroup> |
|||
</Path.RenderTransform> |
|||
</Path> |
|||
</Canvas> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style x:Key="ColorCanvasSliderStyle" TargetType="{x:Type Slider}"> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type Slider}"> |
|||
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/> |
|||
<RowDefinition Height="Auto"/> |
|||
</Grid.RowDefinitions> |
|||
<TickBar x:Name="TopTick" Fill="{TemplateBinding Foreground}" Height="4" Placement="Top" Grid.Row="0" Visibility="Collapsed"/> |
|||
<TickBar x:Name="BottomTick" Fill="{TemplateBinding Foreground}" Height="4" Placement="Bottom" Grid.Row="2" Visibility="Collapsed"/> |
|||
<Border x:Name="TrackBackground" BorderBrush="{StaticResource HorizontalSliderTrackNormalBorder}" BorderThickness="1" Background="{StaticResource HorizontalSliderTrackNormalBackground}" CornerRadius="1" Height="4.0" Margin="5,0" Grid.Row="1" VerticalAlignment="center"> |
|||
<Canvas Margin="-6,-1"> |
|||
<Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Height="4.0" Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" Visibility="Hidden"/> |
|||
</Canvas> |
|||
</Border> |
|||
<Track x:Name="PART_Track" Grid.Row="1"> |
|||
<Track.DecreaseRepeatButton> |
|||
<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/> |
|||
</Track.DecreaseRepeatButton> |
|||
<Track.IncreaseRepeatButton> |
|||
<RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/> |
|||
</Track.IncreaseRepeatButton> |
|||
<Track.Thumb> |
|||
<Thumb x:Name="Thumb" Style="{StaticResource CustomThumbForSlider}"/> |
|||
</Track.Thumb> |
|||
</Track> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="{x:Type local:ColorCanvas}"> |
|||
<Setter Property="Background" Value="{StaticResource ColorCanvasBackgroundBrush}" /> |
|||
<Setter Property="BorderBrush" Value="{StaticResource ColorPickerDarkBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:ColorCanvas}"> |
|||
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Padding="3"> |
|||
<Grid Margin="2"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto"/> |
|||
</Grid.RowDefinitions> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions > |
|||
<ColumnDefinition Width="200"></ColumnDefinition> |
|||
<ColumnDefinition Width="Auto"></ColumnDefinition> |
|||
</Grid.ColumnDefinitions> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<Border BorderThickness="1" BorderBrush="DarkGray" ClipToBounds="True" Background="{StaticResource CheckerBrush}"> |
|||
<Canvas x:Name="PART_ColorShadingCanvas" Width="200" Height="100" HorizontalAlignment="Left" VerticalAlignment="Top"> |
|||
<Rectangle x:Name="ColorShadingRectangle" Height="{Binding ElementName=PART_ColorShadingCanvas,Path=Height}" Width="{Binding ElementName=PART_ColorShadingCanvas,Path=Width}" |
|||
Fill="{Binding SelectedColor, ElementName=PART_SpectrumSlider, Converter={StaticResource ColorToSolidColorBrushConverter}}" /> |
|||
<Rectangle x:Name="WhiteGradient" Width="{Binding ElementName=PART_ColorShadingCanvas,Path=Width}" Height="{Binding ElementName=PART_ColorShadingCanvas,Path=Height}" > |
|||
<Rectangle.Fill> |
|||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> |
|||
<GradientStop Offset="0" Color="#ffffffff"/> |
|||
<GradientStop Offset="1" Color="Transparent"/> |
|||
</LinearGradientBrush> |
|||
</Rectangle.Fill> |
|||
</Rectangle> |
|||
<Rectangle x:Name="BlackGradient" Width="{Binding ElementName=PART_ColorShadingCanvas,Path=Width}" Height="{Binding ElementName=PART_ColorShadingCanvas,Path=Height}" > |
|||
<Rectangle.Fill> |
|||
<LinearGradientBrush StartPoint="0,1" EndPoint="0, 0"> |
|||
<GradientStop Offset="0" Color="#ff000000"/> |
|||
<GradientStop Offset="1" Color="#00000000"/> |
|||
</LinearGradientBrush> |
|||
</Rectangle.Fill> |
|||
</Rectangle> |
|||
<Canvas x:Name="PART_ColorShadeSelector" Width="10" Height="10" IsHitTestVisible="False"> |
|||
<Ellipse Width="10" Height="10" StrokeThickness="3" Stroke="#FFFFFFFF" IsHitTestVisible="False" /> |
|||
<Ellipse Width="10" Height="10" StrokeThickness="1" Stroke="#FF000000" IsHitTestVisible="False" /> |
|||
</Canvas> |
|||
</Canvas> |
|||
</Border> |
|||
|
|||
<Border Grid.Row="1" Margin="0,5,0,0"> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
<Border Background="{StaticResource CheckerBrush}" Height="22" Margin="2,0,2,0" BorderThickness="1" BorderBrush="#FFC9CACA"> |
|||
<Rectangle x:Name="SelectedColor" Fill="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ColorToSolidColorBrushConverter}}" /> |
|||
</Border> |
|||
<TextBox Grid.Column="1" Text="{Binding HexadecimalString, RelativeSource={RelativeSource TemplatedParent}}" Margin="2,0,2,0" VerticalAlignment="Center" Style="{StaticResource ColorCanvasTextBoxStyle}" /> |
|||
</Grid> |
|||
</Border> |
|||
|
|||
<Border Grid.Column="1" Grid.RowSpan="2" Margin="4,-8,0,0" ClipToBounds="False"> |
|||
<local:ColorSpectrumSlider x:Name="PART_SpectrumSlider" VerticalAlignment="Stretch" /> |
|||
</Border> |
|||
</Grid> |
|||
|
|||
<Border MinWidth="180" Grid.Row="1" BorderThickness="1" ClipToBounds="True" Margin="0,10,0,0"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto"/> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto"/> |
|||
<ColumnDefinition Width="*"/> |
|||
<ColumnDefinition Width="Auto"/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Grid.Row="0" Grid.Column="0" Text="R" |
|||
VerticalAlignment="Center"/> |
|||
<Slider x:Name="PART_RSlider" Maximum="255" TickFrequency="1" Grid.Row="0" Grid.Column="1" Margin="4,6,4,6" |
|||
Style="{StaticResource ColorCanvasSliderStyle}" |
|||
Value="{Binding R, RelativeSource={RelativeSource TemplatedParent}}" |
|||
VerticalAlignment="Center"/> |
|||
<TextBox Grid.Row="0" Grid.Column="2" Text="{Binding Value, ElementName=PART_RSlider, StringFormat=F0}" |
|||
VerticalAlignment="Center" |
|||
Style="{StaticResource ColorCanvasTextBoxStyle}"/> |
|||
|
|||
<TextBlock Grid.Row="1" Grid.Column="0" Text="G" |
|||
VerticalAlignment="Center"/> |
|||
<Slider x:Name="PART_GSlider" Maximum="255" TickFrequency="1" Grid.Row="1" Grid.Column="1" Margin="4,6,4,6" |
|||
Style="{StaticResource ColorCanvasSliderStyle}" |
|||
Value="{Binding G, RelativeSource={RelativeSource TemplatedParent}}" |
|||
VerticalAlignment="Center"/> |
|||
<TextBox Grid.Row="1" Grid.Column="2" Text="{Binding Value, ElementName=PART_GSlider, StringFormat=F0}" |
|||
VerticalAlignment="Center" Style="{StaticResource ColorCanvasTextBoxStyle}"/> |
|||
|
|||
<TextBlock Grid.Row="2" Grid.Column="0" Text="B" |
|||
VerticalAlignment="Center"/> |
|||
<Slider x:Name="PART_BSlider" Maximum="255" TickFrequency="1" Grid.Row="2" Grid.Column="1" Margin="4,6,4,6" |
|||
Style="{StaticResource ColorCanvasSliderStyle}" |
|||
Value="{Binding B, RelativeSource={RelativeSource TemplatedParent}}" |
|||
VerticalAlignment="Center"/> |
|||
<TextBox Grid.Row="2" Grid.Column="3" Text="{Binding Value, ElementName=PART_BSlider, StringFormat=F0}" |
|||
VerticalAlignment="Center" Style="{StaticResource ColorCanvasTextBoxStyle}"/> |
|||
|
|||
<TextBlock Grid.Row="3" Grid.Column="0" Text="A" |
|||
VerticalAlignment="Center"/> |
|||
<Slider x:Name="PART_OpacitySlider" Grid.Row="3" Grid.Column="1" Maximum="255" Margin="4,6,4,6" |
|||
Style="{StaticResource ColorCanvasSliderStyle}" |
|||
Value="{Binding Path=A, RelativeSource={RelativeSource TemplatedParent}}" |
|||
VerticalAlignment="Center"/> |
|||
<TextBox Grid.Row="3" Grid.Column="3" Text="{Binding Value, ElementName=PART_OpacitySlider, StringFormat=F0}" |
|||
VerticalAlignment="Center" Style="{StaticResource ColorCanvasTextBoxStyle}"/> |
|||
|
|||
</Grid> |
|||
</Border> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="{x:Type local:ColorSpectrumSlider}"> |
|||
<Setter Property="Orientation" Value="Vertical"/> |
|||
<Setter Property="Background" Value="Transparent"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> |
|||
<Setter Property="Minimum" Value="1"/> |
|||
<Setter Property="Maximum" Value="360"/> |
|||
<Setter Property="TickFrequency" Value="0.001" /> |
|||
<Setter Property="IsSnapToTickEnabled" Value="True" /> |
|||
<Setter Property="IsDirectionReversed" Value="False" /> |
|||
<Setter Property="IsMoveToPointEnabled" Value="True" /> |
|||
<Setter Property="Value" Value="360" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:ColorSpectrumSlider}"> |
|||
<Grid> |
|||
<Border x:Name="PART_TrackBackground" BorderBrush="DarkGray" BorderThickness="1" Width="15" Margin="0,8,0,0" > |
|||
<Rectangle x:Name="PART_SpectrumDisplay" Stretch="Fill" VerticalAlignment="Stretch" /> |
|||
</Border> |
|||
|
|||
<Track Name="PART_Track"> |
|||
<Track.DecreaseRepeatButton> |
|||
<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="Slider.DecreaseLarge"/> |
|||
</Track.DecreaseRepeatButton> |
|||
<Track.IncreaseRepeatButton> |
|||
<RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="Slider.IncreaseLarge"/> |
|||
</Track.IncreaseRepeatButton> |
|||
<Track.Thumb> |
|||
<Thumb Style="{StaticResource VerticalSlideThumbStyle}" /> |
|||
</Track.Thumb> |
|||
</Track> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,275 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" |
|||
xmlns:coreConverters="clr-namespace:Microsoft.Windows.Controls.Core.Converters" |
|||
xmlns:chrome="clr-namespace:Microsoft.Windows.Controls.Chromes"> |
|||
|
|||
<SolidColorBrush x:Key="ButtonHover" Color="#C2E0FF"/> |
|||
<SolidColorBrush x:Key="ButtonHoverBorder" Color="#3399FF"/> |
|||
<SolidColorBrush x:Key="ButtonChecked" Color="#E6F0FA"/> |
|||
<SolidColorBrush x:Key="ButtonPressed" Color="#99CCFF"/> |
|||
<SolidColorBrush x:Key="ButtonPressedBorder" Color="#3399FF"/> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- ColorPicker --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> |
|||
<coreConverters:InverseBoolConverter x:Key="InverseBoolConverter" /> |
|||
<coreConverters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" /> |
|||
|
|||
<LinearGradientBrush x:Key="ColorPickerDarkBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0"> |
|||
<GradientStop Color="#FFA3AEB9" Offset="0"/> |
|||
<GradientStop Color="#FF8399A9" Offset="0.375"/> |
|||
<GradientStop Color="#FF718597" Offset="0.375"/> |
|||
<GradientStop Color="#FF617584" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="PopupBackgroundBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFffffff"/> |
|||
<GradientStop Offset="1" Color="#FFE8EBED"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<DrawingBrush x:Key="CheckerBrush" Viewport="0,0,10,10" ViewportUnits="Absolute" TileMode="Tile"> |
|||
<DrawingBrush.Drawing> |
|||
<DrawingGroup> |
|||
<GeometryDrawing Brush="White"> |
|||
<GeometryDrawing.Geometry> |
|||
<RectangleGeometry Rect="0,0 100,100" /> |
|||
</GeometryDrawing.Geometry> |
|||
</GeometryDrawing> |
|||
<GeometryDrawing Brush="LightGray"> |
|||
<GeometryDrawing.Geometry> |
|||
<GeometryGroup> |
|||
<RectangleGeometry Rect="0,0 50,50" /> |
|||
<RectangleGeometry Rect="50,50 50,50" /> |
|||
</GeometryGroup> |
|||
</GeometryDrawing.Geometry> |
|||
</GeometryDrawing> |
|||
</DrawingGroup> |
|||
</DrawingBrush.Drawing> |
|||
</DrawingBrush> |
|||
|
|||
<Style x:Key="ColorPaletteLisBoxStyle" TargetType="{x:Type ListBoxItem}"> |
|||
<Setter Property="ToolTip" Value="{Binding Name}" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type ListBoxItem}"> |
|||
<Grid ToolTip="{Binding Name}"> |
|||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> |
|||
<Border BorderThickness="1" Background="Transparent" BorderBrush="Transparent" x:Name="_outerBorder" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
|||
<Border Background="Transparent" BorderThickness="1" BorderBrush="Transparent" x:Name="_innerBorder" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> |
|||
</Border> |
|||
</Grid> |
|||
<ControlTemplate.Triggers> |
|||
<Trigger Property="IsMouseOver" Value="True"> |
|||
<Setter TargetName="_outerBorder" Property="BorderBrush" Value="#FFFF0000" /> |
|||
<Setter TargetName="_innerBorder" Property="BorderBrush" Value="#FFFFFF00" /> |
|||
</Trigger> |
|||
<Trigger Property="IsSelected" Value="True"> |
|||
<Setter TargetName="_outerBorder" Property="BorderBrush" Value="#FFFF0000" /> |
|||
<Setter TargetName="_innerBorder" Property="BorderBrush" Value="#FFFFFF00" /> |
|||
</Trigger> |
|||
</ControlTemplate.Triggers> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<DataTemplate x:Key="ColorItemTemplate"> |
|||
<Grid> |
|||
<Border BorderBrush="#FFC9CACA" BorderThickness="1" Margin="2,2,2,2" > |
|||
<Rectangle Width="14" Height="14"> |
|||
<Rectangle.Style> |
|||
<Style TargetType="Rectangle"> |
|||
<Setter Property="Fill" Value="{Binding Color, Converter={StaticResource ColorToSolidColorBrushConverter}}" /> |
|||
<Style.Triggers> |
|||
<DataTrigger Binding="{Binding Name}" Value="Transparent"> |
|||
<Setter Property="Fill" Value="{StaticResource CheckerBrush}" /> |
|||
</DataTrigger> |
|||
</Style.Triggers> |
|||
</Style> |
|||
</Rectangle.Style> |
|||
</Rectangle> |
|||
</Border> |
|||
</Grid> |
|||
</DataTemplate> |
|||
|
|||
<Style x:Key="ColorPickerToggleButtonStyle" TargetType="ToggleButton"> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="ToggleButton"> |
|||
<Grid SnapsToDevicePixels="True"> |
|||
<chrome:ButtonChrome x:Name="ToggleButtonChrome" |
|||
RenderChecked="{Binding IsOpen, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorPicker}}" |
|||
RenderEnabled="{Binding IsEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorPicker}}" |
|||
RenderMouseOver="{TemplateBinding IsMouseOver}" |
|||
RenderPressed="{TemplateBinding IsPressed}" /> |
|||
|
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*"/> |
|||
<ColumnDefinition Width="Auto"/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
|||
|
|||
<Grid x:Name="arrowGlyph" IsHitTestVisible="False" Grid.Column="1" Margin="5"> |
|||
<Path Width="7" Height="4" Data="M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z" Fill="#FF000000"/> |
|||
</Grid> |
|||
</Grid> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style x:Key="ColorDisplayStyle" TargetType="Border"> |
|||
<Setter Property="Background" Value="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ColorToSolidColorBrushConverter}}" /> |
|||
<Style.Triggers> |
|||
<DataTrigger Binding="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}}" Value="Transparent"> |
|||
<Setter Property="Background" Value="{StaticResource CheckerBrush}" /> |
|||
</DataTrigger> |
|||
</Style.Triggers> |
|||
</Style> |
|||
|
|||
<Style TargetType="{x:Type local:ColorPicker}"> |
|||
<Setter Property="BorderBrush" Value="{StaticResource ColorPickerDarkBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="ButtonStyle" Value="{StaticResource ColorPickerToggleButtonStyle}" /> |
|||
<Setter Property="Focusable" Value="False" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:ColorPicker}"> |
|||
<Grid> |
|||
<ToggleButton x:Name="PART_ColorPickerToggleButton" IsTabStop="False" MinHeight="22" IsChecked="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" |
|||
IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" |
|||
Style="{TemplateBinding ButtonStyle}"> |
|||
<Grid Margin="2,2,0,2"> |
|||
<Border x:Name="ColorOnly" Style="{StaticResource ColorDisplayStyle}" /> |
|||
|
|||
<Border x:Name="ColorAndName" Background="White" Visibility="Hidden"> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<Border HorizontalAlignment="Left" Width="20" Margin="2,1,4,1" Style="{StaticResource ColorDisplayStyle}" BorderThickness="1" BorderBrush="#FFC9CACA" /> |
|||
<TextBlock Text="{Binding SelectedColorText, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Grid> |
|||
</ToggleButton> |
|||
|
|||
<Popup x:Name="PART_ColorPickerPalettePopup" VerticalAlignment="Bottom" IsOpen="{Binding ElementName=PART_ColorPickerToggleButton, Path=IsChecked}" StaysOpen="False" AllowsTransparency="True" Focusable="False" HorizontalOffset="1" VerticalOffset="1" > |
|||
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource ColorPickerDarkBorderBrush}" Padding="3"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<Grid x:Name="_gridStandardColorsHost" Margin="4"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<!-- Available Colors --> |
|||
<Grid Grid.Row="1" Visibility="{TemplateBinding ShowAvailableColors, Converter={StaticResource BooleanToVisibilityConverter}}"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition /> |
|||
</Grid.RowDefinitions> |
|||
<TextBlock Text="Available Colors" Background="AliceBlue" Padding="2" Margin="0,0,0,1" /> |
|||
<ListBox x:Name="PART_AvailableColors" Grid.Row="1" Background="Transparent" BorderThickness="0" SelectionMode="Single" |
|||
ItemsSource="{Binding AvailableColors, RelativeSource={RelativeSource TemplatedParent}}" |
|||
ItemTemplate="{StaticResource ColorItemTemplate}" |
|||
ItemContainerStyle="{StaticResource ColorPaletteLisBoxStyle}"> |
|||
<ListBox.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<WrapPanel Width="200" /> |
|||
</ItemsPanelTemplate> |
|||
</ListBox.ItemsPanel> |
|||
</ListBox> |
|||
</Grid> |
|||
</Grid> |
|||
|
|||
<!-- Standard Colors--> |
|||
<Grid Grid.Row="2" Visibility="{TemplateBinding ShowStandardColors, Converter={StaticResource BooleanToVisibilityConverter}}"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<TextBlock Text="Standard Colors" Background="AliceBlue" Padding="2" Margin="0,1,0,1"/> |
|||
<ListBox x:Name="PART_StandardColors" Grid.Row="1" SelectionMode="Single" Background="Transparent" BorderThickness="0" |
|||
ItemsSource="{Binding StandardColors, RelativeSource={RelativeSource TemplatedParent}}" |
|||
ItemTemplate="{StaticResource ColorItemTemplate}" |
|||
ItemContainerStyle="{StaticResource ColorPaletteLisBoxStyle}"> |
|||
<ListBox.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<WrapPanel Width="200" /> |
|||
</ItemsPanelTemplate> |
|||
</ListBox.ItemsPanel> |
|||
</ListBox> |
|||
</Grid> |
|||
</Grid> |
|||
|
|||
<!-- Recent Colors--> |
|||
<Grid Grid.Row="3" Margin="0,1,0,1" Visibility="{TemplateBinding ShowRecentColors, Converter={StaticResource BooleanToVisibilityConverter}}"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<TextBlock Text="Recent Colors" Background="AliceBlue" Padding="2" Margin="0,1,0,1"/> |
|||
<ListBox x:Name="PART_RecentColors" Grid.Row="1" SelectionMode="Single" Background="Transparent" BorderThickness="0" |
|||
ItemsSource="{Binding RecentColors, RelativeSource={RelativeSource TemplatedParent}}" |
|||
ItemTemplate="{StaticResource ColorItemTemplate}" |
|||
ItemContainerStyle="{StaticResource ColorPaletteLisBoxStyle}"> |
|||
<ListBox.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<WrapPanel Width="200" /> |
|||
</ItemsPanelTemplate> |
|||
</ListBox.ItemsPanel> |
|||
</ListBox> |
|||
</Grid> |
|||
</Grid> |
|||
</Grid> |
|||
|
|||
<!-- ColorCanvas --> |
|||
<Grid x:Name="_colorCanvasHost" Visibility="Collapsed"> |
|||
<local:ColorCanvas x:Name="PART_ColorCanvas" Background="Transparent" BorderThickness="0" |
|||
SelectedColor="{Binding SelectedColor, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" /> |
|||
</Grid> |
|||
|
|||
<Separator Grid.Row="1" HorizontalAlignment="Stretch" Margin="5,0,5,0" /> |
|||
|
|||
<!-- More Colors Button --> |
|||
<ToggleButton x:Name="_colorMode" Grid.Row="2" Content="Advanced" Margin="5" Visibility="{TemplateBinding ShowAdvancedButton, Converter={StaticResource BooleanToVisibilityConverter}}" /> |
|||
</Grid> |
|||
</Border> |
|||
</Popup> |
|||
</Grid> |
|||
<ControlTemplate.Triggers> |
|||
<Trigger Property="DisplayColorAndName" Value="True"> |
|||
<Setter TargetName="ColorOnly" Property="Visibility" Value="Collapsed" /> |
|||
<Setter TargetName="ColorAndName" Property="Visibility" Value="Visible" /> |
|||
</Trigger> |
|||
<Trigger SourceName="_colorMode" Property="IsChecked" Value="True"> |
|||
<Setter TargetName="_colorMode" Property="Content" Value="Standard" /> |
|||
<Setter TargetName="_colorCanvasHost" Property="Visibility" Value="Visible" /> |
|||
<Setter TargetName="_gridStandardColorsHost" Property="Visibility" Value="Collapsed" /> |
|||
</Trigger> |
|||
</ControlTemplate.Triggers> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,92 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" |
|||
xmlns:chrome="clr-namespace:Microsoft.Windows.Controls.Chromes" |
|||
xmlns:coreConverters="clr-namespace:Microsoft.Windows.Controls.Core.Converters" |
|||
xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"> |
|||
|
|||
<coreConverters:InverseBoolConverter x:Key="InverseBoolConverter" /> |
|||
|
|||
<LinearGradientBrush x:Key="PopupDarkBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0"> |
|||
<GradientStop Color="#FFA3AEB9" Offset="0"/> |
|||
<GradientStop Color="#FF8399A9" Offset="0.375"/> |
|||
<GradientStop Color="#FF718597" Offset="0.375"/> |
|||
<GradientStop Color="#FF617584" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="PopupBackgroundBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFffffff"/> |
|||
<GradientStop Offset="1" Color="#FFE8EBED"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<Style x:Key="DateTimePickerToggleButtonStyle" TargetType="ToggleButton"> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="ToggleButton"> |
|||
<Grid SnapsToDevicePixels="True"> |
|||
<chrome:ButtonChrome x:Name="ToggleButtonChrome" |
|||
CornerRadius="0,2.75,2.75,0" |
|||
RenderMouseOver="{TemplateBinding IsMouseOver}" |
|||
RenderPressed="{TemplateBinding IsPressed}" /> |
|||
|
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*"/> |
|||
<ColumnDefinition Width="Auto"/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
|||
|
|||
<Grid x:Name="arrowGlyph" IsHitTestVisible="False" Grid.Column="1" Margin="5"> |
|||
<Path Width="7" Height="4" Data="M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z" Fill="#FF000000"/> |
|||
</Grid> |
|||
</Grid> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- DateTimePicker --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<Style TargetType="{x:Type local:DateTimePicker}"> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:DateTimePicker}"> |
|||
<Border> |
|||
<Grid> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
</Grid.ColumnDefinitions> |
|||
<local:DateTimeUpDown BorderThickness="1,1,0,1" Format="{TemplateBinding Format}" FormatString="{TemplateBinding FormatString}" |
|||
Value="{Binding SelectedDate, RelativeSource={RelativeSource TemplatedParent}}" /> |
|||
<ToggleButton x:Name="_calendarToggleButton" Grid.Column="1" |
|||
IsChecked="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}}" |
|||
Style="{StaticResource DateTimePickerToggleButtonStyle}" |
|||
IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}"/> |
|||
</Grid> |
|||
<Popup IsOpen="{Binding IsChecked, ElementName=_calendarToggleButton}" StaysOpen="False"> |
|||
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" Padding="3"> |
|||
<StackPanel> |
|||
<toolkit:Calendar x:Name="Part_Calendar" |
|||
DisplayDate="{Binding SelectedDate, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"/> |
|||
<local:DateTimeUpDown x:Name="Part_TimeUpDown" Format="ShortTime" Value="{Binding SelectedDate, RelativeSource={RelativeSource TemplatedParent}}" Background="White" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Popup> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,36 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls"> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- DateTimeUpDown --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<Style TargetType="{x:Type local:DateTimeUpDown}"> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/> |
|||
<Setter Property="Focusable" Value="False" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:DateTimeUpDown}"> |
|||
<local:ButtonSpinner x:Name="Spinner" IsTabStop="False" BorderThickness="{TemplateBinding BorderThickness}"> |
|||
<TextBox x:Name="TextBox" BorderThickness="0" |
|||
Background="{TemplateBinding Background}" |
|||
FontFamily="{TemplateBinding FontFamily}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
FontStretch="{TemplateBinding FontStretch}" |
|||
FontStyle="{TemplateBinding FontStyle}" |
|||
FontWeight="{TemplateBinding FontWeight}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
IsReadOnly="True" |
|||
MinWidth="20" AcceptsReturn="False" |
|||
TextAlignment="Right" TextWrapping="NoWrap" |
|||
TabIndex="{TemplateBinding TabIndex}" |
|||
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}}" /> |
|||
</local:ButtonSpinner> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,39 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" |
|||
xmlns:magConverters="clr-namespace:Microsoft.Windows.Controls.Mag.Converters"> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- Magnifier --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<magConverters:RadiusConverter x:Key="RadiusConverter"/> |
|||
<magConverters:BorderThicknessToStrokeThicknessConverter x:Key="BorderThicknessToStrokeThicknessConverter"/> |
|||
|
|||
<Style TargetType="{x:Type local:Magnifier}"> |
|||
<Setter Property="IsHitTestVisible" Value="False"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:Magnifier}"> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="{Binding Path=Radius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource RadiusConverter}}"/> |
|||
</Grid.ColumnDefinitions> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="{Binding Path=Radius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource RadiusConverter}}"/> |
|||
</Grid.RowDefinitions> |
|||
<Ellipse Width="{Binding Path=MagnifierWidth, RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=MagnifierHeight, RelativeSource={RelativeSource TemplatedParent}}" Fill="{TemplateBinding Background}"/> |
|||
<Ellipse Stroke="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="{Binding Path=BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BorderThicknessToStrokeThicknessConverter}}"> |
|||
<Ellipse.Fill> |
|||
<VisualBrush Viewbox="{Binding Path=ViewBox, RelativeSource={RelativeSource TemplatedParent}}" |
|||
ViewboxUnits="Absolute" |
|||
Visual="{Binding Path=Target, RelativeSource={RelativeSource TemplatedParent}}"/> |
|||
</Ellipse.Fill> |
|||
</Ellipse> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,36 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:chrome="clr-namespace:Microsoft.Windows.Controls.Chromes" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" |
|||
xmlns:coreConverters="clr-namespace:Microsoft.Windows.Controls.Core.Converters"> |
|||
|
|||
<coreConverters:InverseBoolConverter x:Key="InverseBoolConverter" /> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- MaskedTextBox --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<Style TargetType="{x:Type local:MaskedTextBox}"> |
|||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/> |
|||
<Setter Property="Focusable" Value="False" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:MaskedTextBox}"> |
|||
<TextBox x:Name="TextBox" |
|||
Background="{TemplateBinding Background}" |
|||
FontFamily="{TemplateBinding FontFamily}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
FontStretch="{TemplateBinding FontStretch}" |
|||
FontStyle="{TemplateBinding FontStyle}" |
|||
FontWeight="{TemplateBinding FontWeight}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
IsReadOnly="{Binding IsEditable, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" |
|||
MinWidth="20" AcceptsReturn="False" TextWrapping="NoWrap" |
|||
TabIndex="{TemplateBinding TabIndex}" |
|||
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}}" /> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,299 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls"> |
|||
|
|||
<LinearGradientBrush x:Key="WindowDarkBrush" EndPoint="0.5,1" StartPoint="0.5,0"> |
|||
<GradientStop Color="#FFA3AEB9" Offset="0"/> |
|||
<GradientStop Color="#FF8399A9" Offset="0.375"/> |
|||
<GradientStop Color="#FF718597" Offset="0.375"/> |
|||
<GradientStop Color="#FF617584" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="WindowBackgroundBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFffffff"/> |
|||
<GradientStop Offset="0.479" Color="#FFf4f5f6"/> |
|||
<GradientStop Offset="1" Color="#FFd0d6db"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="WindowButtonHoverBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFb5bdc8"/> |
|||
<GradientStop Offset="0.370" Color="#FF8399a9"/> |
|||
<GradientStop Offset="0.370" Color="#FF718597"/> |
|||
<GradientStop Offset="0.906" Color="#FFb9c1ca"/> |
|||
<GradientStop Offset="1" Color="#FFb9c1ca"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="WindowButtonPressedBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FF6b7c8d"/> |
|||
<GradientStop Offset="0.370" Color="#FF4d606f"/> |
|||
<GradientStop Offset="0.370" Color="#FF465460"/> |
|||
<GradientStop Offset="0.906" Color="#FF262d33"/> |
|||
<GradientStop Offset="1" Color="#FF262d33"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<Style x:Key="WindowCloseButtonStyle" TargetType="Button"> |
|||
<Setter Property="Foreground" Value="#FF000000"/> |
|||
<Setter Property="Padding" Value="3"/> |
|||
<Setter Property="BorderThickness" Value="1"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="Button"> |
|||
<Grid> |
|||
<VisualStateManager.VisualStateGroups> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal"/> |
|||
<VisualState x:Name="MouseOver"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource WindowButtonHoverBrush}"></DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
<VisualState x:Name="Pressed"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource WindowButtonPressedBrush}"></DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateManager.VisualStateGroups> |
|||
<Border x:Name="Background" CornerRadius="0,0,2,0" Background="{StaticResource WindowDarkBrush}"> |
|||
<Border Margin="1,0,1,1" BorderBrush="#59FFFFFF" BorderThickness="1" CornerRadius="0,0,1,0"/> |
|||
</Border> |
|||
<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/> |
|||
<Path x:Name="path" |
|||
Height="6" |
|||
Width="7" |
|||
Stretch="Fill" |
|||
Opacity="1" |
|||
Data="M 2,6 C2,6 3,6 3,6 3,6 3,5 3,5 3,5 4,5 4,5 4,5 4,6 4,6 4,6 5,6 5,6 5,6 7,6 7,6 7,6 7,5 7,5 7,5 6,5 6,5 6,5 6,4 6,4 6,4 5,4 5,4 5,4 5,2 5,2 5,2 6,2 6,2 6,2 6,1 6,1 6,1 7,1 7,1 7,1 7,0 7,0 7,0 5,0 5,0 5,0 4,0 4,0 4,0 4,1 4,1 4,1 3,1 3,1 3,1 3,0 3,0 3,0 2,0 2,0 2,0 0,0 0,0 0,0 0,1 0,1 0,1 1,1 1,1 1,1 1,2 1,2 1,2 2,2 2,2 2,2 2,4 2,4 2,4 1,4 1,4 1,4 1,5 1,5 1,5 0,5 0,5 0,5 0,6 0,6 0,6 2,6 2,6 z" |
|||
Fill="White" Margin="0,0,0,1" Visibility="Collapsed" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- MessageBox --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<ControlTemplate x:Key="MessageBoxDragWidgetTemplate" TargetType="{x:Type Thumb}"> |
|||
<Border Background="Transparent"> |
|||
</Border> |
|||
</ControlTemplate> |
|||
|
|||
<Style TargetType="{x:Type local:MessageBox}"> |
|||
<Setter Property="Background" Value="#FFFFFFFF"/> |
|||
<Setter Property="BorderBrush" Value="{StaticResource WindowDarkBrush}" /> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="CaptionForeground" Value="#FF000000" /> |
|||
<Setter Property="CloseButtonStyle" Value="{StaticResource WindowCloseButtonStyle}" /> |
|||
<Setter Property="Focusable" Value="False" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
|||
<Setter Property="IsEnabled" Value="true" /> |
|||
<Setter Property="MinWidth" Value="350" /> |
|||
<Setter Property="MinHeight" Value="50" /> |
|||
<Setter Property="MaxHeight" Value="250" /> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Top" /> |
|||
<Setter Property="WindowBorderBrush" Value="{StaticResource WindowDarkBrush}" /> |
|||
<Setter Property="WindowBackground" Value="{StaticResource WindowBackgroundBrush}" /> |
|||
<Setter Property="WindowOpacity" Value="1.0" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:MessageBox}"> |
|||
<Grid x:Name="Root"> |
|||
<VisualStateManager.VisualStateGroups> |
|||
<VisualStateGroup x:Name="group1"> |
|||
<VisualState x:Name="OK"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_OkButton" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="0"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
<VisualState x:Name="OKCancel"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_OkButton" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="0"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_CancelButton" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="0"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
<VisualState x:Name="YesNo"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_YesButton" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="0"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_NoButton" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="0"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
|
|||
<VisualState x:Name="YesNoCancel"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_YesButton" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="0"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_NoButton" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="0"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_CancelButton" Storyboard.TargetProperty="Visibility"> |
|||
<DiscreteObjectKeyFrame KeyTime="0"> |
|||
<DiscreteObjectKeyFrame.Value> |
|||
<Visibility>Visible</Visibility> |
|||
</DiscreteObjectKeyFrame.Value> |
|||
</DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateManager.VisualStateGroups> |
|||
|
|||
<!-- Borders --> |
|||
<Grid x:Name="MessageBoxWindowGrid"> |
|||
<Border BorderBrush="{TemplateBinding WindowBorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5,5,0,0" Opacity="{TemplateBinding WindowOpacity}"/> |
|||
<Grid Margin="0" Background="{x:Null}"> |
|||
<Border x:Name="MessageBoxWindow" Margin="1,1,1,1" Background="{TemplateBinding WindowBackground}" CornerRadius="4,4,0,0" Opacity="{TemplateBinding WindowOpacity}"/> |
|||
<Border BorderBrush="White" BorderThickness="1" CornerRadius="4,4,0,0" Margin="1" Opacity="0.7"/> |
|||
</Grid> |
|||
</Grid> |
|||
|
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" MinHeight="26"/> |
|||
<RowDefinition /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<!-- Content Border --> |
|||
<Grid Margin="6,0,6,6" x:Name="ContentGrid" Grid.Row="1"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition/> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Border BorderBrush="#FFFFFFFF" BorderThickness="1" CornerRadius="1"/> |
|||
<Border Margin="1" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0.1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"> |
|||
|
|||
<Grid MinWidth="350"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<Grid Margin="24,16,24,22"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto"/> |
|||
<ColumnDefinition Width="*"/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<!-- Message Image --> |
|||
<Image x:Name="MessageBoxImage" VerticalAlignment="Top" SnapsToDevicePixels="True" Stretch="None" Margin="-6,-1,10,-4" Source="{TemplateBinding ImageSource}"></Image> |
|||
|
|||
<!-- Message Text --> |
|||
<ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Auto"> |
|||
<TextBlock x:Name="MessageText" TextWrapping="Wrap" VerticalAlignment="Center" MaxWidth="450" |
|||
Text="{TemplateBinding Text}" |
|||
FontFamily="{TemplateBinding FontFamily}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
FontStyle="{TemplateBinding FontStyle}" |
|||
FontWeight="{TemplateBinding FontWeight}" |
|||
Foreground="{TemplateBinding Foreground}"/> |
|||
</ScrollViewer> |
|||
|
|||
</Grid> |
|||
|
|||
<!-- Buttons --> |
|||
<Grid Grid.Row="1" HorizontalAlignment="Right" Margin="12,0,12,12"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto"/> |
|||
<ColumnDefinition Width="Auto"/> |
|||
<ColumnDefinition Width="Auto"/> |
|||
<ColumnDefinition Width="Auto"/> |
|||
</Grid.ColumnDefinitions> |
|||
<Button Grid.Column="0" x:Name="PART_YesButton" MinWidth="65" Margin="6,0,0,0" Visibility="Collapsed">Yes</Button> |
|||
<Button Grid.Column="1" x:Name="PART_NoButton" MinWidth="65" Margin="6,0,0,0" Visibility="Collapsed">No</Button> |
|||
<Button Grid.Column="2" x:Name="PART_OkButton" MinWidth="65" Margin="6,0,0,0" Visibility="Collapsed">OK</Button> |
|||
<Button Grid.Column="3" x:Name="PART_CancelButton" MinWidth="65" Margin="6,0,0,0" Visibility="Collapsed">Cancel</Button> |
|||
</Grid> |
|||
</Grid> |
|||
</Border> |
|||
</Grid> |
|||
|
|||
<!-- Header --> |
|||
<Border x:Name="HeaderArea" Background="Transparent" Grid.Column="1" CornerRadius="5,5,0,0" Margin="1,1,1,0"> |
|||
<Grid> |
|||
<Grid x:Name="CaptionHeader" Margin="1,1,105,0" VerticalAlignment="Center"> |
|||
<!-- Caption --> |
|||
<ContentControl x:Name="Caption" Margin="5,0,0,0" IsTabStop="False" HorizontalAlignment="Stretch" |
|||
Content="{TemplateBinding Caption}" |
|||
Foreground="{TemplateBinding CaptionForeground}"/> |
|||
|
|||
</Grid> |
|||
<Thumb x:Name="PART_DragWidget" Template="{StaticResource MessageBoxDragWidgetTemplate}" IsTabStop="False" /> |
|||
</Grid> |
|||
</Border> |
|||
|
|||
</Grid> |
|||
|
|||
<Border x:Name="Resize" BorderThickness="7" BorderBrush="Transparent" /> |
|||
|
|||
<!-- Close Button --> |
|||
<Border BorderBrush="#A5FFFFFF" BorderThickness="1,0,1,1" CornerRadius="0,0,3,3" VerticalAlignment="Top" Margin="0,1,7,0" HorizontalAlignment="Right"> |
|||
<Button x:Name="PART_CloseButton" Style="{TemplateBinding CloseButtonStyle}" Height="17" Width="43" IsTabStop="False"> |
|||
<Path Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" Width="12" Fill="#E4FFFFFF" Stretch="Fill" Stroke="#FF535666" |
|||
Data="M0.5,0.5 L4.5178828,0.5 L6.0620003,3.125 L7.4936447,0.5 L11.5,0.5 L11.5,1.5476431 L8.7425003,6.1201854 L11.5,10.359666 L11.5,11.5 L7.4941902,11.5 L6.0620003,8.8740005 L4.5172949,11.5 L0.5,11.5 L0.5,10.43379 L3.3059995,6.1201582 L0.5,1.4676378 L0.5,0.5 z"/> |
|||
</Button> |
|||
</Border> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,37 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" |
|||
xmlns:coreConverters="clr-namespace:Microsoft.Windows.Controls.Core.Converters"> |
|||
|
|||
<coreConverters:InverseBoolConverter x:Key="InverseBoolConverter" /> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- NumericUpDown --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<Style TargetType="{x:Type local:NumericUpDown}"> |
|||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:NumericUpDown}"> |
|||
<local:ButtonSpinner x:Name="Spinner" IsTabStop="False"> |
|||
<TextBox x:Name="TextBox" BorderThickness="0" |
|||
Background="{TemplateBinding Background}" |
|||
FontFamily="{TemplateBinding FontFamily}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
FontStretch="{TemplateBinding FontStretch}" |
|||
FontStyle="{TemplateBinding FontStyle}" |
|||
FontWeight="{TemplateBinding FontWeight}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
IsReadOnly="{Binding IsEditable, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" |
|||
MinWidth="20" AcceptsReturn="False" |
|||
TextAlignment="Right" TextWrapping="NoWrap" |
|||
TabIndex="{TemplateBinding TabIndex}" |
|||
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}}" /> |
|||
</local:ButtonSpinner> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
|
After Width: | Height: | Size: 156 B |
|
After Width: | Height: | Size: 333 B |
|
After Width: | Height: | Size: 201 B |
|
After Width: | Height: | Size: 205 B |
|
After Width: | Height: | Size: 142 B |
|
After Width: | Height: | Size: 340 B |
|
After Width: | Height: | Size: 442 B |
|
After Width: | Height: | Size: 303 B |
@ -0,0 +1,368 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls.PropertyGrid" |
|||
xmlns:converters="clr-namespace:Microsoft.Windows.Controls.Core.Converters" |
|||
xmlns:pgConverters="clr-namespace:Microsoft.Windows.Controls.PropertyGrid.Converters" |
|||
xmlns:utilities="clr-namespace:Microsoft.Windows.Controls.Core.Utilities" |
|||
xmlns:commands="clr-namespace:Microsoft.Windows.Controls.PropertyGrid.Commands"> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- PropertyGrid --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> |
|||
<converters:InverseBoolConverter x:Key="InverseBoolConverter" /> |
|||
<pgConverters:ValueSourceToImagePathConverter x:Key="ValueSourceToImagePathConverter" /> |
|||
<pgConverters:ValueSourceToToolTipConverter x:Key="ValueSourceToToolTipConverter" /> |
|||
|
|||
<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="OptionsToggleButtonStyle" TargetType="{x:Type RadioButton}"> |
|||
<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 RadioButton}"> |
|||
<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> |
|||
|
|||
<SolidColorBrush x:Key="GlyphBrush" Color="#FF31347C"/> |
|||
|
|||
<ControlTemplate x:Key="ExpanderToggleButton" TargetType="{x:Type ToggleButton}"> |
|||
<Grid> |
|||
<Rectangle Margin="0,0,0,0" x:Name="Rectangle" Fill="Transparent" /> |
|||
<Path HorizontalAlignment="Center" x:Name="Up_Arrow" VerticalAlignment="Center" Fill="{StaticResource GlyphBrush}" Data="M 0 0 L 4 4 L 8 0 Z" RenderTransformOrigin="0.5,0.5"> |
|||
<Path.RenderTransform> |
|||
<TransformGroup> |
|||
<ScaleTransform ScaleX="1" ScaleY="1" /> |
|||
<SkewTransform AngleX="0" AngleY="0" /> |
|||
<RotateTransform Angle="-90" /> |
|||
<TranslateTransform X="0" Y="0" /> |
|||
</TransformGroup> |
|||
</Path.RenderTransform> |
|||
</Path> |
|||
<Path Visibility="Collapsed" HorizontalAlignment="Center" x:Name="Down_Arrow" VerticalAlignment="Center" Fill="{StaticResource GlyphBrush}" Data="M 0 4 L 4 0 L 8 4 Z" RenderTransformOrigin="0.5,0.5"> |
|||
<Path.RenderTransform> |
|||
<TransformGroup> |
|||
<ScaleTransform ScaleX="1" ScaleY="1" /> |
|||
<SkewTransform AngleX="0" AngleY="0" /> |
|||
<RotateTransform Angle="135" /> |
|||
<TranslateTransform X="0" Y="0" /> |
|||
</TransformGroup> |
|||
</Path.RenderTransform> |
|||
</Path> |
|||
</Grid> |
|||
<ControlTemplate.Triggers> |
|||
<Trigger Property="IsChecked" Value="true"> |
|||
<Setter Property="Visibility" Value="Visible" TargetName="Down_Arrow" /> |
|||
<Setter Property="Visibility" Value="Collapsed" TargetName="Up_Arrow" /> |
|||
<Setter Property="OpacityMask" TargetName="Down_Arrow" Value="#FF000000" /> |
|||
</Trigger> |
|||
</ControlTemplate.Triggers> |
|||
</ControlTemplate> |
|||
|
|||
<Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}"> |
|||
<Setter Property="Padding" Value="0" /> |
|||
<Setter Property="Background" Value="#FFF0F0F0" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type Expander}"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" x:Name="ContentRow" /> |
|||
</Grid.RowDefinitions> |
|||
<Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="#FFF0F0F0"> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="20" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
<ToggleButton Template="{StaticResource ExpanderToggleButton}" IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" OverridesDefaultStyle="True" /> |
|||
<ContentPresenter Grid.Column="1" Margin="1" RecognizesAccessKey="True" ContentSource="Header" TextElement.FontWeight="Bold" /> |
|||
</Grid> |
|||
</Border> |
|||
<Border Visibility="Collapsed" Grid.Row="1" x:Name="ExpandSite" Background="#FFF0F0F0" Padding="10 0 0 0"> |
|||
|
|||
<Border Background="#FFFFFF" BorderThickness="0" Margin="0" Padding="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> |
|||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Focusable="false" /> |
|||
</Border> |
|||
|
|||
</Border> |
|||
</Grid> |
|||
<ControlTemplate.Triggers> |
|||
<Trigger Property="IsExpanded" Value="True"> |
|||
<Setter Property="Visibility" Value="Visible" TargetName="ExpandSite" /> |
|||
</Trigger> |
|||
</ControlTemplate.Triggers> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="{x:Type local:PropertyCategoryItem}"> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:PropertyCategoryItem}"> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}"> |
|||
<Expander Header="{TemplateBinding Category}" Style="{StaticResource ExpanderStyle}" IsExpanded="True"> |
|||
<ItemsControl ItemsSource="{Binding Properties, RelativeSource={RelativeSource TemplatedParent}}" /> |
|||
</Expander> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="{x:Type local:PropertyItem}"> |
|||
<Setter Property="BorderBrush" Value="#FFF0F0F0" /> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="Focusable" Value="True"/> |
|||
<Setter Property="IsTabStop" Value="False" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:PropertyItem}"> |
|||
<ControlTemplate.Resources> |
|||
<ContextMenu x:Key="ContextMenu"> |
|||
<MenuItem Header="Reset Value" Command="commands:PropertyItemCommands.ResetValue" /> |
|||
</ContextMenu> |
|||
</ControlTemplate.Resources> |
|||
<Border Background="White" ContextMenu="{StaticResource ContextMenu}" ContextMenuService.Placement="Bottom"> |
|||
<Grid VerticalAlignment="Center" HorizontalAlignment="Stretch"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="{Binding NameColumnWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PropertyGrid}}}"/> |
|||
<ColumnDefinition Width="*"/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<Border BorderThickness="0.5" BorderBrush="#FFF0F0F0" x:Name="PART_Name"> |
|||
<Grid Margin="7,2,2,2"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="{Binding Name, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Stretch" TextTrimming="CharacterEllipsis"/> |
|||
|
|||
<Grid Grid.Column="1" HorizontalAlignment="Right" Margin="5,0,5,0" |
|||
utilities:ContextMenuUtilities.OpenOnMouseLeftButtonClick="True" |
|||
ContextMenu="{StaticResource ContextMenu}" > |
|||
|
|||
<Image x:Name="_optionsImage" Width="11" Height="11" |
|||
Source="{Binding ValueSource, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ValueSourceToImagePathConverter}}" |
|||
ToolTip="{Binding ValueSource, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ValueSourceToToolTipConverter}}" /> |
|||
</Grid> |
|||
</Grid> |
|||
</Border> |
|||
|
|||
<Border BorderThickness="0.5" BorderBrush="#FFF0F0F0" x:Name="PART_Editor" Grid.Column="1" Background="Transparent"> |
|||
<ContentControl Content="{TemplateBinding Editor}" VerticalAlignment="Center" Focusable="False" IsTabStop="False" /> |
|||
</Border> |
|||
</Grid> |
|||
</Border> |
|||
<ControlTemplate.Triggers> |
|||
<DataTrigger Binding="{Binding IsDataBound, RelativeSource={RelativeSource Self}}" Value="True"> |
|||
<Setter TargetName="_optionsImage" Property="Source" Value="/WPFToolkit.Extended;component/PropertyGrid/Images/Database11.png" /> |
|||
<Setter TargetName="_optionsImage" Property="ToolTip" Value="Databinding" /> |
|||
</DataTrigger> |
|||
<DataTrigger Binding="{Binding IsDynamicResource, RelativeSource={RelativeSource Self}}" Value="True"> |
|||
<Setter TargetName="_optionsImage" Property="Source" Value="/WPFToolkit.Extended;component/PropertyGrid/Images/Resource11.png" /> |
|||
<Setter TargetName="_optionsImage" Property="ToolTip" Value="Resource" /> |
|||
</DataTrigger> |
|||
<DataTrigger Binding="{Binding HasResourceApplied, RelativeSource={RelativeSource Self}}" Value="True"> |
|||
<Setter TargetName="_optionsImage" Property="Source" Value="/WPFToolkit.Extended;component/PropertyGrid/Images/Resource11.png" /> |
|||
<Setter TargetName="_optionsImage" Property="ToolTip" Value="Resource" /> |
|||
</DataTrigger> |
|||
<Trigger Property="IsMouseOver" Value="True"> |
|||
<Setter TargetName="PART_Name" Property="Background" Value="#CED4DF" /> |
|||
</Trigger> |
|||
<Trigger Property="IsSelected" Value="True"> |
|||
<Setter TargetName="PART_Name" Property="Background" Value="#43577B" /> |
|||
<Setter TargetName="PART_Name" Property="TextElement.Foreground" Value="White" /> |
|||
</Trigger> |
|||
</ControlTemplate.Triggers> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="{x:Type local:PropertyGrid}"> |
|||
<Setter Property="Background" Value="#CED4DF" /> |
|||
<Setter Property="BorderBrush" Value="#43577B" /> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:PropertyGrid}"> |
|||
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition /> |
|||
<RowDefinition Height="5" /> |
|||
<RowDefinition Height="Auto"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<StackPanel Orientation="Horizontal" Margin="6,2,0,4"> |
|||
<TextBlock Text="{TemplateBinding SelectedObjectTypeName}" FontWeight="Bold"/> |
|||
<TextBlock Text="{TemplateBinding SelectedObjectName}" Margin="5,0,0,0" /> |
|||
</StackPanel> |
|||
|
|||
<Grid Grid.Row="1" Margin="4,0,4,4"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto"/> |
|||
<ColumnDefinition Width="*"/> |
|||
</Grid.ColumnDefinitions> |
|||
<Grid Background="#BCC7D8" Margin="4"> |
|||
<StackPanel Orientation="Horizontal" Margin="1" > |
|||
<RadioButton IsChecked="{Binding IsCategorized, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" |
|||
Style="{StaticResource OptionsToggleButtonStyle}" ToolTip="Categorized"> |
|||
<Image Source="/WPFToolkit.Extended;component/PropertyGrid/Images/Categorize16.png" Width="16" Height="16" /> |
|||
</RadioButton> |
|||
<RadioButton IsChecked="{Binding IsCategorized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}, Mode=OneWay}" VerticalAlignment="Center" |
|||
Style="{StaticResource OptionsToggleButtonStyle}" ToolTip="Alphabetical"> |
|||
<Image Source="/WPFToolkit.Extended;component/PropertyGrid/Images/SortAscending16.png" Width="16" Height="16"/> |
|||
</RadioButton> |
|||
</StackPanel> |
|||
</Grid> |
|||
<TextBox Grid.Column="1" Text="Not Implemented" Margin="4" Opacity=".5" Visibility="Hidden" /> |
|||
</Grid> |
|||
|
|||
<Grid Grid.Row="2" Background="White"> |
|||
<ScrollViewer VerticalScrollBarVisibility="Auto"> |
|||
<ItemsControl ItemsSource="{Binding Properties, RelativeSource={RelativeSource TemplatedParent}}" IsTabStop="False" Focusable="False" > |
|||
<ItemsControl.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<VirtualizingStackPanel /> |
|||
</ItemsPanelTemplate> |
|||
</ItemsControl.ItemsPanel> |
|||
</ItemsControl> |
|||
</ScrollViewer> |
|||
|
|||
<Thumb x:Name="PART_DragThumb" HorizontalAlignment="Left" Width="5" Margin="6,0,0,0" Cursor="SizeWE"> |
|||
<Thumb.RenderTransform> |
|||
<TranslateTransform X="{Binding NameColumnWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PropertyGrid}}}" /> |
|||
</Thumb.RenderTransform> |
|||
<Thumb.Template> |
|||
<ControlTemplate> |
|||
<Border Background="Transparent" /> |
|||
</ControlTemplate> |
|||
</Thumb.Template> |
|||
</Thumb> |
|||
|
|||
</Grid> |
|||
|
|||
<GridSplitter Height="3" Grid.Row="3" HorizontalAlignment="Stretch" Visibility="{Binding DisplaySummary, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" /> |
|||
<StackPanel Grid.Row="4" Margin="0,0,0,5" Visibility="{Binding DisplaySummary, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}"> |
|||
<TextBlock Padding="2 2 2 0" FontWeight="Bold" Text="{Binding SelectedProperty.Name, RelativeSource={RelativeSource TemplatedParent}}" /> |
|||
<TextBlock Padding="5 2 2 0" TextWrapping="WrapWithOverflow" Text="{Binding SelectedProperty.Description, RelativeSource={RelativeSource TemplatedParent}}" /> |
|||
</StackPanel> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,104 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:chrome="clr-namespace:Microsoft.Windows.Controls.Chromes" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" |
|||
xmlns:coreConverters="clr-namespace:Microsoft.Windows.Controls.Core.Converters"> |
|||
|
|||
<coreConverters:InverseBoolConverter x:Key="InverseBoolConverter" /> |
|||
|
|||
<LinearGradientBrush x:Key="ColorPickerDarkBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0"> |
|||
<GradientStop Color="#FFA3AEB9" Offset="0"/> |
|||
<GradientStop Color="#FF8399A9" Offset="0.375"/> |
|||
<GradientStop Color="#FF718597" Offset="0.375"/> |
|||
<GradientStop Color="#FF617584" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="PopupBackgroundBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFffffff"/> |
|||
<GradientStop Offset="1" Color="#FFE8EBED"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- SplitButton --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<Style TargetType="{x:Type local:SplitButton}"> |
|||
<Setter Property="BorderThickness" Value="1"/> |
|||
<Setter Property="IsTabStop" Value="False" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Padding" Value="3"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:SplitButton}"> |
|||
<Grid x:Name="MainGrid" SnapsToDevicePixels="True"> |
|||
<chrome:ButtonChrome x:Name="ControlChrome" RenderEnabled="{TemplateBinding IsEnabled}"/> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
</Grid.ColumnDefinitions> |
|||
<Button x:Name="PART_ActionButton" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" > |
|||
<Button.Template> |
|||
<ControlTemplate TargetType="Button"> |
|||
<ContentPresenter /> |
|||
</ControlTemplate> |
|||
</Button.Template> |
|||
<Grid> |
|||
<chrome:ButtonChrome x:Name="ActionButtonChrome" |
|||
CornerRadius="2.75, 0, 0, 2.75" |
|||
RenderNormal="False" |
|||
RenderEnabled="{TemplateBinding IsEnabled}" |
|||
RenderMouseOver="{Binding IsMouseOver, ElementName=PART_ActionButton}" |
|||
RenderPressed="{Binding IsPressed, ElementName=PART_ActionButton}" /> |
|||
<ContentPresenter Name="ActionButtonContent" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="true" /> |
|||
</Grid> |
|||
</Button> |
|||
<ToggleButton x:Name="PART_ToggleButton" Grid.Column="1" IsTabStop="False" |
|||
IsChecked="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" |
|||
IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" > |
|||
<ToggleButton.Template> |
|||
<ControlTemplate TargetType="ToggleButton"> |
|||
<ContentPresenter /> |
|||
</ControlTemplate> |
|||
</ToggleButton.Template> |
|||
<Grid> |
|||
<chrome:ButtonChrome x:Name="ToggleButtonChrome" |
|||
CornerRadius="0, 2.75, 2.75, 0" |
|||
RenderNormal="False" |
|||
RenderChecked="{TemplateBinding IsOpen}" |
|||
RenderEnabled="{TemplateBinding IsEnabled}" |
|||
RenderMouseOver="{Binding IsMouseOver, ElementName=PART_ToggleButton}" |
|||
RenderPressed="{Binding IsPressed, ElementName=PART_ToggleButton}" /> |
|||
<Grid x:Name="arrowGlyph" IsHitTestVisible="False" Margin="4,3,4,3"> |
|||
<Path Width="7" Height="4" Data="M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z" Fill="#FF000000"/> |
|||
</Grid> |
|||
</Grid> |
|||
</ToggleButton> |
|||
</Grid> |
|||
|
|||
<Popup x:Name="PART_Popup" |
|||
HorizontalOffset="1" |
|||
VerticalOffset="1" |
|||
AllowsTransparency="True" |
|||
StaysOpen="False" |
|||
Placement="Bottom" |
|||
Focusable="False" |
|||
IsOpen="{Binding IsChecked, ElementName=PART_ToggleButton}"> |
|||
<!-- TODO: Create Popup Styles that can be reused on all popups in the toolkit--> |
|||
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource ColorPickerDarkBorderBrush}" > |
|||
<ContentPresenter Content="{TemplateBinding DropDownContent}" /> |
|||
</Border> |
|||
</Popup> |
|||
|
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,99 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="clr-namespace:System;assembly=mscorlib" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" |
|||
xmlns:coreConverters="clr-namespace:Microsoft.Windows.Controls.Core.Converters" |
|||
xmlns:magConverters="clr-namespace:Microsoft.Windows.Controls.Mag.Converters" |
|||
xmlns:chrome="clr-namespace:Microsoft.Windows.Controls.Chromes"> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- Common Styles --> |
|||
<!-- Need to find a way to share these for ChildWIndow and MessageBox --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<LinearGradientBrush x:Key="WindowDarkBrush" EndPoint="0.5,1" StartPoint="0.5,0"> |
|||
<GradientStop Color="#FFA3AEB9" Offset="0"/> |
|||
<GradientStop Color="#FF8399A9" Offset="0.375"/> |
|||
<GradientStop Color="#FF718597" Offset="0.375"/> |
|||
<GradientStop Color="#FF617584" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="WindowBackgroundBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFffffff"/> |
|||
<GradientStop Offset="0.479" Color="#FFf4f5f6"/> |
|||
<GradientStop Offset="1" Color="#FFd0d6db"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="WindowButtonHoverBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFb5bdc8"/> |
|||
<GradientStop Offset="0.370" Color="#FF8399a9"/> |
|||
<GradientStop Offset="0.370" Color="#FF718597"/> |
|||
<GradientStop Offset="0.906" Color="#FFb9c1ca"/> |
|||
<GradientStop Offset="1" Color="#FFb9c1ca"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="WindowButtonPressedBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FF6b7c8d"/> |
|||
<GradientStop Offset="0.370" Color="#FF4d606f"/> |
|||
<GradientStop Offset="0.370" Color="#FF465460"/> |
|||
<GradientStop Offset="0.906" Color="#FF262d33"/> |
|||
<GradientStop Offset="1" Color="#FF262d33"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<Style x:Key="WindowCloseButtonStyle" TargetType="Button"> |
|||
<Setter Property="Foreground" Value="#FF000000"/> |
|||
<Setter Property="Padding" Value="3"/> |
|||
<Setter Property="BorderThickness" Value="1"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="Button"> |
|||
<Grid> |
|||
<VisualStateManager.VisualStateGroups> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal"/> |
|||
<VisualState x:Name="MouseOver"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource WindowButtonHoverBrush}"></DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
<VisualState x:Name="Pressed"> |
|||
<Storyboard> |
|||
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background)"> |
|||
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource WindowButtonPressedBrush}"></DiscreteObjectKeyFrame> |
|||
</ObjectAnimationUsingKeyFrames> |
|||
</Storyboard> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateManager.VisualStateGroups> |
|||
<Border x:Name="Background" CornerRadius="0,0,2,0" Background="{StaticResource WindowDarkBrush}"> |
|||
<Border Margin="1,0,1,1" BorderBrush="#59FFFFFF" BorderThickness="1" CornerRadius="0,0,1,0"/> |
|||
</Border> |
|||
<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/> |
|||
<Path x:Name="path" |
|||
Height="6" |
|||
Width="7" |
|||
Stretch="Fill" |
|||
Opacity="1" |
|||
Data="M 2,6 C2,6 3,6 3,6 3,6 3,5 3,5 3,5 4,5 4,5 4,5 4,6 4,6 4,6 5,6 5,6 5,6 7,6 7,6 7,6 7,5 7,5 7,5 6,5 6,5 6,5 6,4 6,4 6,4 5,4 5,4 5,4 5,2 5,2 5,2 6,2 6,2 6,2 6,1 6,1 6,1 7,1 7,1 7,1 7,0 7,0 7,0 5,0 5,0 5,0 4,0 4,0 4,0 4,1 4,1 4,1 3,1 3,1 3,1 3,0 3,0 3,0 2,0 2,0 2,0 0,0 0,0 0,0 0,1 0,1 0,1 1,1 1,1 1,1 1,2 1,2 1,2 2,2 2,2 2,2 2,4 2,4 2,4 1,4 1,4 1,4 1,5 1,5 1,5 0,5 0,5 0,5 0,6 0,6 0,6 2,6 2,6 z" |
|||
Fill="White" Margin="0,0,0,1" Visibility="Collapsed" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,93 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" |
|||
xmlns:chrome="clr-namespace:Microsoft.Windows.Controls.Chromes" |
|||
xmlns:coreConverters="clr-namespace:Microsoft.Windows.Controls.Core.Converters"> |
|||
|
|||
<coreConverters:InverseBoolConverter x:Key="InverseBoolConverter" /> |
|||
<coreConverters:TimeFormatToDateTimeFormatConverter x:Key="TimeFormatToDateTimeFormatConverter" /> |
|||
|
|||
<LinearGradientBrush x:Key="PopupDarkBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0"> |
|||
<GradientStop Color="#FFA3AEB9" Offset="0"/> |
|||
<GradientStop Color="#FF8399A9" Offset="0.375"/> |
|||
<GradientStop Color="#FF718597" Offset="0.375"/> |
|||
<GradientStop Color="#FF617584" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="PopupBackgroundBrush" StartPoint="0,0" EndPoint="0,1"> |
|||
<LinearGradientBrush.GradientStops> |
|||
<GradientStopCollection> |
|||
<GradientStop Offset="0" Color="#FFffffff"/> |
|||
<GradientStop Offset="1" Color="#FFE8EBED"/> |
|||
</GradientStopCollection> |
|||
</LinearGradientBrush.GradientStops> |
|||
</LinearGradientBrush> |
|||
|
|||
<Style x:Key="TimePickerToggleButtonStyle" TargetType="ToggleButton"> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="ToggleButton"> |
|||
<Grid SnapsToDevicePixels="True"> |
|||
<chrome:ButtonChrome x:Name="ToggleButtonChrome" |
|||
CornerRadius="0,2.75,2.75,0" |
|||
RenderMouseOver="{TemplateBinding IsMouseOver}" |
|||
RenderPressed="{TemplateBinding IsPressed}" /> |
|||
|
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*"/> |
|||
<ColumnDefinition Width="Auto"/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
|||
|
|||
<Grid x:Name="arrowGlyph" IsHitTestVisible="False" Grid.Column="1" Margin="5"> |
|||
<Path Width="7" Height="4" Data="M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z" Fill="#FF000000"/> |
|||
</Grid> |
|||
</Grid> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<!-- =============================================================================== --> |
|||
<!-- TimePicker --> |
|||
<!-- =============================================================================== --> |
|||
|
|||
<Style TargetType="{x:Type local:TimePicker}"> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:TimePicker}"> |
|||
<Border> |
|||
<Grid> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
</Grid.ColumnDefinitions> |
|||
<local:DateTimeUpDown x:Name="PART_TimeUpDown" BorderThickness="1,1,0,1" |
|||
Format="{TemplateBinding Format, Converter={StaticResource TimeFormatToDateTimeFormatConverter}}" |
|||
FormatString="{TemplateBinding FormatString}" |
|||
Value="{Binding SelectedDate, RelativeSource={RelativeSource TemplatedParent}}" /> |
|||
<ToggleButton x:Name="_timePickerToggleButton" Grid.Column="1" |
|||
IsChecked="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}}" |
|||
Style="{StaticResource TimePickerToggleButtonStyle}" |
|||
IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}"/> |
|||
</Grid> |
|||
<Popup IsOpen="{Binding IsChecked, ElementName=_timePickerToggleButton}" StaysOpen="False"> |
|||
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource PopupDarkBorderBrush}" > |
|||
<ListBox x:Name="PART_TimeListItems" BorderThickness="0" |
|||
SelectedItem="{Binding SelectedTime, RelativeSource={RelativeSource TemplatedParent}}"> |
|||
|
|||
</ListBox> |
|||
</Border> |
|||
</Popup> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,96 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls"> |
|||
|
|||
<LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0"> |
|||
<GradientStop Color="#ABADB3" Offset="0.05"/> |
|||
<GradientStop Color="#E2E3EA" Offset="0.07"/> |
|||
<GradientStop Color="#E3E9EF" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="TextBox_MouseOver" EndPoint="0,1" StartPoint="0,0"> |
|||
<GradientStop Color="#5794BF" Offset="0.05"/> |
|||
<GradientStop Color="#B7D5EA" Offset="0.07"/> |
|||
<GradientStop Color="#C7E2F1" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<LinearGradientBrush x:Key="TextBox_Focused" EndPoint="0,1" StartPoint="0,0"> |
|||
<GradientStop Color="#3D7BAD" Offset="0.05"/> |
|||
<GradientStop Color="#A4C9E3" Offset="0.07"/> |
|||
<GradientStop Color="#B7D9ED" Offset="1"/> |
|||
</LinearGradientBrush> |
|||
|
|||
<SolidColorBrush x:Key="TextBox_DisabledBorder" Color="#ADB2B5" /> |
|||
<SolidColorBrush x:Key="TextBox_DisabledBackground" Color="#F4F4F4" /> |
|||
|
|||
<DataTemplate x:Key="DefaultWatermarkTemplate"> |
|||
<ContentControl Content="{Binding}" Foreground="Gray" /> |
|||
</DataTemplate> |
|||
|
|||
<Style TargetType="{x:Type local:WatermarkTextBox}"> |
|||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> |
|||
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/> |
|||
<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/> |
|||
<Setter Property="BorderThickness" Value="1"/> |
|||
<Setter Property="Padding" Value="3" /> |
|||
<Setter Property="AllowDrop" Value="true"/> |
|||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/> |
|||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/> |
|||
<Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:WatermarkTextBox}"> |
|||
<Grid> |
|||
|
|||
<Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="1" Background="{TemplateBinding Background}"> |
|||
|
|||
</Border> |
|||
|
|||
<Border x:Name="MouseOverVisual" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{StaticResource TextBox_MouseOver}" CornerRadius="1" > |
|||
|
|||
</Border> |
|||
|
|||
<Border x:Name="FocusVisual" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{StaticResource TextBox_Focused}" CornerRadius="1" > |
|||
|
|||
</Border> |
|||
|
|||
<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
|||
|
|||
<ContentPresenter x:Name="PART_WatermarkHost" |
|||
Content="{TemplateBinding Watermark}" |
|||
ContentTemplate="{TemplateBinding WatermarkTemplate}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
IsHitTestVisible="False" |
|||
Margin="{TemplateBinding Padding}" |
|||
Visibility="Collapsed"/> |
|||
|
|||
</Grid> |
|||
<ControlTemplate.Triggers> |
|||
<MultiTrigger> |
|||
<MultiTrigger.Conditions> |
|||
<Condition Property="IsFocused" Value="False"></Condition> |
|||
<Condition Property="Text" Value=""></Condition> |
|||
</MultiTrigger.Conditions> |
|||
<MultiTrigger.Setters> |
|||
<Setter Property="Visibility" TargetName="PART_WatermarkHost" Value="Visible"></Setter> |
|||
</MultiTrigger.Setters> |
|||
</MultiTrigger> |
|||
<Trigger Property="IsMouseOver" Value="True"> |
|||
<Setter TargetName="MouseOverVisual" Property="Opacity" Value="1" /> |
|||
</Trigger> |
|||
<Trigger Property="IsFocused" Value="True"> |
|||
<Setter TargetName="FocusVisual" Property="Opacity" Value="1" /> |
|||
</Trigger> |
|||
<Trigger Property="IsEnabled" Value="false"> |
|||
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource TextBox_DisabledBorder}"/> |
|||
<Setter TargetName="Border" Property="Background" Value="{StaticResource TextBox_DisabledBackground}"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> |
|||
</Trigger> |
|||
</ControlTemplate.Triggers> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||