This question is locked. New answers and comments are not allowed.
Hello,
I have created a new style for the SelectionChrome of the CalendarButtonStyle however the MouseOver and Pressed Visual States are not working.
I added the Style to the "SelectionChrome" of the CalendarButtonStyle.
<Chromes:ButtonChrome Style="{StaticResource ButtonChromeCalTacom}" x:Name="SelectionChrome" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}" Margin="{StaticResource CalendarButtonButtonChromeMargin}" RenderNormal="False" RenderSelected="{TemplateBinding IsSelected}" RenderFocused="{TemplateBinding IsFocused}" RenderHighlighted="{TemplateBinding IsMouseOver}" />
Here is they style created.
<!-- rek added chrome style for calendar button -->
<SolidColorBrush x:Key="ChromeCalBackground_Normal"/>
<SolidColorBrush x:Key="ChromeCalInnerBorder_Normal"/>
<SolidColorBrush x:Key="ChromeCalOuterBorder_Normal"/>
<SolidColorBrush x:Key="ChromeCalBackground_Pressed" Color="#FF888F5A"/>
<SolidColorBrush x:Key="ChromeCalOuterBorder_Pressed" Color="#FF888F5A"/>
<SolidColorBrush x:Key="ChromeCalInnerBorder_Pressed" Color="#FF888F5A"/>
<SolidColorBrush x:Key="ChromeCalBackground_MouseOver" Color="#FFA8AE81"/>
<SolidColorBrush x:Key="ChromeCalInnerBorder_MouseOver" Color="#FFA8AE81"/>
<SolidColorBrush x:Key="ChromeCalOuterBorder_MouseOver" Color="#FF888F5A"/>
<Style x:Key="ButtonChromeCalTacom" TargetType="Chromes:ButtonChrome">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="{StaticResource ChromeCalOuterBorder_Normal}"/>
<Setter Property="Background" Value="{StaticResource ChromeCalBackground_Normal}"/>
<Setter Property="CornerRadius" Value="{StaticResource SplitButton_SpanCornerRadius}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Chromes:ButtonChrome">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="OuterBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalOuterBorder_MouseOver}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="OuterBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalBackground_MouseOver}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="InnerBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalInnerBorder_MouseOver}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="InnerBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalBackground_MouseOver}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="OuterBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalOuterBorder_Pressed}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="InnerBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalInnerBorder_Pressed}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="InnerBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalBackground_Pressed}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="OuterBorder" Background="{StaticResource ChromeCalBackground_Normal}" BorderBrush="{StaticResource ChromeCalOuterBorder_Normal}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}">
<Border x:Name="InnerBorder" Background="{StaticResource ChromeCalBackground_Normal}" BorderBrush="{StaticResource ChromeCalInnerBorder_Normal}" BorderThickness="10" CornerRadius="{TemplateBinding InnerCornerRadius}"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Thank you,
Craig
I have created a new style for the SelectionChrome of the CalendarButtonStyle however the MouseOver and Pressed Visual States are not working.
I added the Style to the "SelectionChrome" of the CalendarButtonStyle.
<Chromes:ButtonChrome Style="{StaticResource ButtonChromeCalTacom}" x:Name="SelectionChrome" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}" Margin="{StaticResource CalendarButtonButtonChromeMargin}" RenderNormal="False" RenderSelected="{TemplateBinding IsSelected}" RenderFocused="{TemplateBinding IsFocused}" RenderHighlighted="{TemplateBinding IsMouseOver}" />
Here is they style created.
<!-- rek added chrome style for calendar button -->
<SolidColorBrush x:Key="ChromeCalBackground_Normal"/>
<SolidColorBrush x:Key="ChromeCalInnerBorder_Normal"/>
<SolidColorBrush x:Key="ChromeCalOuterBorder_Normal"/>
<SolidColorBrush x:Key="ChromeCalBackground_Pressed" Color="#FF888F5A"/>
<SolidColorBrush x:Key="ChromeCalOuterBorder_Pressed" Color="#FF888F5A"/>
<SolidColorBrush x:Key="ChromeCalInnerBorder_Pressed" Color="#FF888F5A"/>
<SolidColorBrush x:Key="ChromeCalBackground_MouseOver" Color="#FFA8AE81"/>
<SolidColorBrush x:Key="ChromeCalInnerBorder_MouseOver" Color="#FFA8AE81"/>
<SolidColorBrush x:Key="ChromeCalOuterBorder_MouseOver" Color="#FF888F5A"/>
<Style x:Key="ButtonChromeCalTacom" TargetType="Chromes:ButtonChrome">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="{StaticResource ChromeCalOuterBorder_Normal}"/>
<Setter Property="Background" Value="{StaticResource ChromeCalBackground_Normal}"/>
<Setter Property="CornerRadius" Value="{StaticResource SplitButton_SpanCornerRadius}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Chromes:ButtonChrome">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="OuterBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalOuterBorder_MouseOver}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="OuterBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalBackground_MouseOver}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="InnerBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalInnerBorder_MouseOver}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="InnerBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalBackground_MouseOver}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="OuterBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalOuterBorder_Pressed}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="InnerBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalInnerBorder_Pressed}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="InnerBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ChromeCalBackground_Pressed}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="OuterBorder" Background="{StaticResource ChromeCalBackground_Normal}" BorderBrush="{StaticResource ChromeCalOuterBorder_Normal}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}">
<Border x:Name="InnerBorder" Background="{StaticResource ChromeCalBackground_Normal}" BorderBrush="{StaticResource ChromeCalInnerBorder_Normal}" BorderThickness="10" CornerRadius="{TemplateBinding InnerCornerRadius}"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Thank you,
Craig