Browse Source

initial check in of ButtonChrome control

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
5cc69cc49e
  1. 271
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Chromes/ButtonChrome.cs
  2. 423
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml
  3. 1
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj

271
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Chromes/ButtonChrome.cs

@ -0,0 +1,271 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace Microsoft.Windows.Controls.Chromes
{
public class ButtonChrome : Control
{
#region CornerRadius
public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(ButtonChrome), new UIPropertyMetadata(default(CornerRadius), new PropertyChangedCallback(OnCornerRadiusChanged)));
public CornerRadius CornerRadius
{
get { return (CornerRadius)GetValue(CornerRadiusProperty); }
set { SetValue(CornerRadiusProperty, value); }
}
private static void OnCornerRadiusChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
ButtonChrome buttonChrome = o as ButtonChrome;
if (buttonChrome != null)
buttonChrome.OnCornerRadiusChanged((CornerRadius)e.OldValue, (CornerRadius)e.NewValue);
}
protected virtual void OnCornerRadiusChanged(CornerRadius oldValue, CornerRadius newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //CornerRadius
#region InnerCornerRadius
public static readonly DependencyProperty InnerCornerRadiusProperty = DependencyProperty.Register("InnerCornerRadius", typeof(CornerRadius), typeof(ButtonChrome), new UIPropertyMetadata(default(CornerRadius), new PropertyChangedCallback(OnInnerCornerRadiusChanged)));
public CornerRadius InnerCornerRadius
{
get { return (CornerRadius)GetValue(InnerCornerRadiusProperty); }
set { SetValue(InnerCornerRadiusProperty, value); }
}
private static void OnInnerCornerRadiusChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
ButtonChrome buttonChrome = o as ButtonChrome;
if (buttonChrome != null)
buttonChrome.OnInnerCornerRadiusChanged((CornerRadius)e.OldValue, (CornerRadius)e.NewValue);
}
protected virtual void OnInnerCornerRadiusChanged(CornerRadius oldValue, CornerRadius newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //InnerCornerRadius
#region RenderActive
public static readonly DependencyProperty RenderActiveProperty = DependencyProperty.Register("RenderActive", typeof(bool), typeof(ButtonChrome), new UIPropertyMetadata(false, OnRenderActiveChanged));
public bool RenderActive
{
get { return (bool)GetValue(RenderActiveProperty); }
set { SetValue(RenderActiveProperty, value); }
}
private static void OnRenderActiveChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
ButtonChrome buttonChrome = o as ButtonChrome;
if (buttonChrome != null)
buttonChrome.OnRenderActiveChanged((bool)e.OldValue, (bool)e.NewValue);
}
protected virtual void OnRenderActiveChanged(bool oldValue, bool newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //RenderActive
#region RenderChecked
public static readonly DependencyProperty RenderCheckedProperty = DependencyProperty.Register("RenderChecked", typeof(bool), typeof(ButtonChrome), new UIPropertyMetadata(false, OnRenderCheckedChanged));
public bool RenderChecked
{
get { return (bool)GetValue(RenderCheckedProperty); }
set { SetValue(RenderCheckedProperty, value); }
}
private static void OnRenderCheckedChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
ButtonChrome buttonChrome = o as ButtonChrome;
if (buttonChrome != null)
buttonChrome.OnRenderCheckedChanged((bool)e.OldValue, (bool)e.NewValue);
}
protected virtual void OnRenderCheckedChanged(bool oldValue, bool newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //RenderChecked
#region RenderEnabled
public static readonly DependencyProperty RenderEnabledProperty = DependencyProperty.Register("RenderEnabled", typeof(bool), typeof(ButtonChrome), new UIPropertyMetadata(true, OnRenderEnabledChanged));
public bool RenderEnabled
{
get { return (bool)GetValue(RenderEnabledProperty); }
set { SetValue(RenderEnabledProperty, value); }
}
private static void OnRenderEnabledChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
ButtonChrome buttonChrome = o as ButtonChrome;
if (buttonChrome != null)
buttonChrome.OnRenderEnabledChanged((bool)e.OldValue, (bool)e.NewValue);
}
protected virtual void OnRenderEnabledChanged(bool oldValue, bool newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //RenderEnabled
#region RenderFocused
public static readonly DependencyProperty RenderFocusedProperty = DependencyProperty.Register("RenderFocused", typeof(bool), typeof(ButtonChrome), new UIPropertyMetadata(false, OnRenderFocusedChanged));
public bool RenderFocused
{
get { return (bool)GetValue(RenderFocusedProperty); }
set { SetValue(RenderFocusedProperty, value); }
}
private static void OnRenderFocusedChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
ButtonChrome buttonChrome = o as ButtonChrome;
if (buttonChrome != null)
buttonChrome.OnRenderFocusedChanged((bool)e.OldValue, (bool)e.NewValue);
}
protected virtual void OnRenderFocusedChanged(bool oldValue, bool newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //RenderFocused
#region RenderMouseOver
public static readonly DependencyProperty RenderMouseOverProperty = DependencyProperty.Register("RenderMouseOver", typeof(bool), typeof(ButtonChrome), new UIPropertyMetadata(false, OnRenderMouseOverChanged));
public bool RenderMouseOver
{
get { return (bool)GetValue(RenderMouseOverProperty); }
set { SetValue(RenderMouseOverProperty, value); }
}
private static void OnRenderMouseOverChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
ButtonChrome buttonChrome = o as ButtonChrome;
if (buttonChrome != null)
buttonChrome.OnRenderMouseOverChanged((bool)e.OldValue, (bool)e.NewValue);
}
protected virtual void OnRenderMouseOverChanged(bool oldValue, bool newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //RenderMouseOver
#region RenderNormal
public static readonly DependencyProperty RenderNormalProperty = DependencyProperty.Register("RenderNormal", typeof(bool), typeof(ButtonChrome), new UIPropertyMetadata(true, OnRenderNormalChanged));
public bool RenderNormal
{
get { return (bool)GetValue(RenderNormalProperty); }
set { SetValue(RenderNormalProperty, value); }
}
private static void OnRenderNormalChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
ButtonChrome buttonChrome = o as ButtonChrome;
if (buttonChrome != null)
buttonChrome.OnRenderNormalChanged((bool)e.OldValue, (bool)e.NewValue);
}
protected virtual void OnRenderNormalChanged(bool oldValue, bool newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //RenderNormal
#region RenderPressed
public static readonly DependencyProperty RenderPressedProperty = DependencyProperty.Register("RenderPressed", typeof(bool), typeof(ButtonChrome), new UIPropertyMetadata(false, OnRenderPressedChanged));
public bool RenderPressed
{
get { return (bool)GetValue(RenderPressedProperty); }
set { SetValue(RenderPressedProperty, value); }
}
private static void OnRenderPressedChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
ButtonChrome buttonChrome = o as ButtonChrome;
if (buttonChrome != null)
buttonChrome.OnRenderPressedChanged((bool)e.OldValue, (bool)e.NewValue);
}
protected virtual void OnRenderPressedChanged(bool oldValue, bool newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //RenderPressed
#region RenderSelected
public static readonly DependencyProperty RenderSelectedProperty = DependencyProperty.Register("RenderSelected", typeof(bool), typeof(ButtonChrome), new UIPropertyMetadata(false, OnRenderSelectedChanged));
public bool RenderSelected
{
get { return (bool)GetValue(RenderSelectedProperty); }
set { SetValue(RenderSelectedProperty, value); }
}
private static void OnRenderSelectedChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
ButtonChrome buttonChrome = o as ButtonChrome;
if (buttonChrome != null)
buttonChrome.OnRenderSelectedChanged((bool)e.OldValue, (bool)e.NewValue);
}
protected virtual void OnRenderSelectedChanged(bool oldValue, bool newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //RenderSelected
#region RenderHighlighted
public static readonly DependencyProperty RenderHighlightedProperty = DependencyProperty.Register("RenderHighlighted", typeof(bool), typeof(ButtonChrome), new UIPropertyMetadata(false, OnRenderHighlightedChanged));
public bool RenderHighlighted
{
get { return (bool)GetValue(RenderHighlightedProperty); }
set { SetValue(RenderHighlightedProperty, value); }
}
private static void OnRenderHighlightedChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
ButtonChrome buttonChrome = o as ButtonChrome;
if (buttonChrome != null)
buttonChrome.OnRenderHighlightedChanged((bool)e.OldValue, (bool)e.NewValue);
}
protected virtual void OnRenderHighlightedChanged(bool oldValue, bool newValue)
{
// TODO: Add your property changed side-effects. Descendants can override as well.
}
#endregion //RenderHighlighted
#region Contsructors
static ButtonChrome()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ButtonChrome), new FrameworkPropertyMetadata(typeof(ButtonChrome)));
}
#endregion //Contsructors
}
}

423
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml

@ -3,7 +3,8 @@
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:magConverters="clr-namespace:Microsoft.Windows.Controls.Mag.Converters"
xmlns:chrome="clr-namespace:Microsoft.Windows.Controls.Chromes">
<!-- =============================================================================== -->
<!-- Common Converters -->
@ -1253,4 +1254,424 @@
</Setter.Value>
</Setter>
</Style>
<!-- =============================================================================== -->
<!-- ButtonChrome -->
<!-- =============================================================================== -->
<CornerRadius x:Key="ControlOuterBorderCornerRadius">3</CornerRadius>
<CornerRadius x:Key="ControlInnerBorderCornerRadius">1</CornerRadius>
<!-- Normal -->
<SolidColorBrush x:Key="ControlOuterBorder_Normal" Color="#FF707070" />
<SolidColorBrush x:Key="ControlInnerBorder_Normal" Color="#FFFFFFFF" />
<LinearGradientBrush x:Key="ControlBackground_Normal" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#F3F3F3" Offset="0"/>
<GradientStop Color="#EBEBEB" Offset="0.5"/>
<GradientStop Color="#DDDDDD" Offset="0.5"/>
<GradientStop Color="#CDCDCD" Offset="1"/>
</LinearGradientBrush>
<!-- Active -->
<SolidColorBrush x:Key="ControlOuterBorder_Active" Color="#FFFFC92B" />
<SolidColorBrush x:Key="ControlInnerBorder_Active" Color="#FFFFFFFF" />
<LinearGradientBrush x:Key="ControlBackground_Active" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFFEF3"/>
<GradientStop Color="#FFFAF0AF" Offset="1"/>
</LinearGradientBrush>
<!--Mouse Over-->
<SolidColorBrush x:Key="ControlOuterBorder_MouseOver" Color="#FFFFC92B" />
<SolidColorBrush x:Key="ControlInnerBorder_MouseOver" Color="#FFFFFFFF" />
<LinearGradientBrush x:Key="ControlBackground_MouseOver" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFFBDA" Offset="0"/>
<GradientStop Color="#FFFEEBAE" Offset="0.50"/>
<GradientStop Color="#FFFFD25A" Offset="0.50"/>
<GradientStop Color="#FFFFFBA3" Offset="1"/>
</LinearGradientBrush>
<!-- MouseOver Checked -->
<LinearGradientBrush x:Key="ControlOuterBorder_MouseOverChecked" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF282828"/>
<GradientStop Color="#FF5F5F5F" Offset="1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ControlInnerBorder_MouseOverChecked" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFB69A78"/>
<GradientStop Color="#FFFFE17A" Offset="0.169"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ControlBackground_MouseOverChecked" EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFFFE8AB" Offset="0" />
<GradientStop Color="#FFFFE08F" Offset="0.5" />
<GradientStop Color="#FFFEAF27" Offset="0.5" />
<GradientStop Color="#FFFFE74E" Offset="1" />
</LinearGradientBrush>
<!-- Pressed -->
<LinearGradientBrush x:Key="ControlOuterBorder_Pressed" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF616161" Offset="0"/>
<GradientStop Color="#FF989898" Offset="1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ControlInnerBorder_Pressed" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFB69A78"/>
<GradientStop Color="#FFFFE17A" Offset="0.126"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ControlBackground_Pressed" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFDCAB" Offset="0"/>
<GradientStop Color="#FFFFD18F" Offset="0.5"/>
<GradientStop Color="#FFFE9227" Offset="0.5"/>
<GradientStop Color="#FFFFBA74" Offset="0"/>
</LinearGradientBrush>
<!-- Focused -->
<SolidColorBrush x:Key="ControlOuterBorder_Focused" Color="#FFFFC92B" />
<SolidColorBrush x:Key="ControlInnerBorder_Focused" Color="Transparent" />
<SolidColorBrush x:Key="ControlBackground_Focused" Color="Transparent" />
<!-- Disabled -->
<SolidColorBrush x:Key="ControlOuterBorder_Disabled" Color="#FF9BB0CD" />
<SolidColorBrush x:Key="ControlInnerBorder_Disabled" Color="Transparent" />
<SolidColorBrush x:Key="ControlBackground_Disabled" Color="#FFE2F0FD" />
<!-- Disabled Checked -->
<LinearGradientBrush x:Key="ControlOuterBorder_DisabledChecked" EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF282828" />
<GradientStop Color="#FF5F5F5F" Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="ControlInnerBorder_DisabledChecked" EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFB69A78" />
<GradientStop Color="#FFFFE17A" Offset="0.126" />
</LinearGradientBrush>
<SolidColorBrush x:Key="ControlBackground_DisabledChecked" Color="#FFE2F0FD" />
<!-- Checked -->
<SolidColorBrush x:Key="ControlOuterBorder_Checked" Color="#FFFFC92B" />
<SolidColorBrush x:Key="ControlInnerBorder_Checked" Color="#FFFFFFFF" />
<LinearGradientBrush x:Key="ControlBackground_Checked" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFDCAB" Offset="0" />
<GradientStop Color="#FFFFD18F" Offset="0.5" />
<GradientStop Color="#FFFE9227" Offset="0.5" />
<GradientStop Color="#FFFFD74E" Offset="1" />
</LinearGradientBrush>
<!-- Highlighted -->
<SolidColorBrush x:Key="ControlOuterBorder_Highlighted" Color="#FFFFC92B" />
<SolidColorBrush x:Key="ControlInnerBorder_Highlighted" Color="#FFFFFFFF" />
<LinearGradientBrush x:Key="ControlBackground_Highlighted" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFFBA3" Offset="1"/>
<GradientStop Color="#FFFFFBDA" Offset="0"/>
</LinearGradientBrush>
<!-- Selected -->
<SolidColorBrush x:Key="ControlOuterBorder_Selected" Color="#FFFFC92B" />
<SolidColorBrush x:Key="ControlInnerBorder_Selected" Color="#FFFFFFFF" />
<LinearGradientBrush x:Key="ControlBackground_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFCE79F" Offset="1"/>
<GradientStop Color="#FFFDD3A8"/>
</LinearGradientBrush>
<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="ActiveVisual" Opacity="0" Visibility="Collapsed" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{StaticResource ControlOuterBorder_Active}" Background="{StaticResource ControlBackground_Active}">
<Border x:Name="ActiveInnerVisual" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding InnerCornerRadius}" BorderBrush="{StaticResource ControlInnerBorder_Active}" />
</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 and is checked -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="RenderEnabled" Value="False" />
<Condition Property="RenderChecked" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{StaticResource ControlOuterBorder_DisabledChecked}" />
<Setter TargetName="InnerBorder" Property="BorderBrush" Value="{StaticResource ControlInnerBorder_DisabledChecked}" />
<Setter TargetName="OuterBorder" Property="Background" Value="{StaticResource ControlBackground_DisabledChecked}" />
</MultiTrigger>
<!-- If button is disabled, not checked, and is rendered normal -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="RenderEnabled" Value="False" />
<Condition Property="RenderChecked" Value="False" />
<Condition Property="RenderNormal" Value="True" />
</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, checked, the mouse is over, but it is not pressed -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="RenderEnabled" Value="True" />
<Condition Property="RenderChecked" Value="True" />
<Condition Property="RenderMouseOver" Value="True" />
<Condition Property="RenderPressed" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{StaticResource ControlOuterBorder_MouseOverChecked}" />
<Setter TargetName="InnerBorder" Property="BorderBrush" Value="{StaticResource ControlInnerBorder_MouseOverChecked}" />
<Setter TargetName="OuterBorder" Property="Background" Value="{StaticResource ControlBackground_MouseOverChecked}" />
</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_Checked}" />
<Setter TargetName="InnerBorder" Property="BorderBrush" Value="{StaticResource ControlInnerBorder_Checked}" />
<Setter TargetName="OuterBorder" Property="Background" Value="{StaticResource ControlBackground_Checked}" />
</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 the button is enabled, not checked, is active, not pressed, and the mouse is not over -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="RenderEnabled" Value="True" />
<Condition Property="RenderChecked" Value="False" />
<Condition Property="RenderActive" Value="True" />
<Condition Property="RenderHighlighted" Value="False" />
<Condition Property="RenderSelected" Value="False" />
<Condition Property="RenderPressed" Value="False" />
<Condition Property="RenderMouseOver" Value="False" />
</MultiTrigger.Conditions>
<MultiTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ActiveVisual" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="00:00:00">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ActiveVisual" Storyboard.TargetProperty="Opacity">
<LinearDoubleKeyFrame KeyTime="00:00:00.115" Value="1" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</MultiTrigger.EnterActions>
<MultiTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ActiveVisual" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="00:00:00.150">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ActiveVisual" Storyboard.TargetProperty="Opacity">
<LinearDoubleKeyFrame KeyTime="00:00:00.150" Value="0" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</MultiTrigger.ExitActions>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="RenderEnabled" Value="True" />
<Condition Property="RenderChecked" Value="False" />
<Condition Property="RenderHighlighted" Value="True" />
<Condition Property="RenderMouseOver" Value="False" />
<Condition Property="RenderPressed" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Highlighted}" />
<Setter TargetName="InnerBorder" Property="BorderBrush" Value="{StaticResource ControlInnerBorder_Highlighted}" />
<Setter TargetName="OuterBorder" Property="Background" Value="{StaticResource ControlBackground_Highlighted}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="RenderEnabled" Value="True" />
<Condition Property="RenderChecked" Value="False" />
<Condition Property="RenderHighlighted" Value="False" />
<Condition Property="RenderSelected" Value="True" />
<Condition Property="RenderMouseOver" Value="False" />
<Condition Property="RenderPressed" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Selected}" />
<Setter TargetName="InnerBorder" Property="BorderBrush" Value="{StaticResource ControlInnerBorder_Selected}" />
<Setter TargetName="OuterBorder" Property="Background" Value="{StaticResource ControlBackground_Selected}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="RenderNormal" Value="False" />
<Condition Property="RenderHighlighted" Value="False" />
<Condition Property="RenderSelected" 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>

1
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj

@ -73,6 +73,7 @@
<Compile Include="ButtonSpinner\SpinEventArgs.cs" />
<Compile Include="ButtonSpinner\Spinner.cs" />
<Compile Include="ButtonSpinner\ValidSpinDirections.cs" />
<Compile Include="Chromes\ButtonChrome.cs" />
<Compile Include="ColorPicker\ColorItem.cs" />
<Compile Include="ColorPicker\ColorPicker.cs" />
<Compile Include="ColorPicker\ColorUtilities.cs" />

Loading…
Cancel
Save