
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 1.92 KB | hits: 18 | expires: Never
Binding EasingColorKeyframe Value
<ColorAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetProperty="(TextElement.Foreground).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="mainToggleButton">
<EasingColorKeyFrame KeyTime="0:0:0.2" Value="{Binding RelativeSource={RelativeSource Self}, Path=LowColor}"/>
<EasingColorKeyFrame KeyTime="0:0:0.4" Value="{Binding RelativeSource={RelativeSource Self}, Path=HighColor}"/>
<EasingColorKeyFrame KeyTime="0:0:0.8" Value="{Binding RelativeSource={RelativeSource Self}, Path=HighColor}"/>
<EasingColorKeyFrame KeyTime="0:0:1" Value="{Binding RelativeSource={RelativeSource Self}, Path=LowColor}"/>
<EasingColorKeyFrame KeyTime="0:0:1.4" Value="{Binding RelativeSource={RelativeSource Self}, Path=HighColor}"/>
</ColorAnimationUsingKeyFrames>
[Category("Flash")]
public Brush HighColor
{
get { return (Brush)GetValue(HighColorProperty); }
set { SetValue(HighColorProperty, value); }
}
// Using a DependencyProperty as the backing store for HighColor. This enables animation, styling, binding, etc...
public static readonly DependencyProperty HighColorProperty =
DependencyProperty.Register("HighColor", typeof(Brush), typeof(AttentionControl), new UIPropertyMetadata(Brushes.LightGreen));
[Category("Flash")]
public Brush LowColor
{
get { return (Brush)GetValue(LowColorProperty); }
set { SetValue(LowColorProperty, value); }
}
// Using a DependencyProperty as the backing store for LowColor. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LowColorProperty =
DependencyProperty.Register("LowColor", typeof(Brush), typeof(AttentionControl), new UIPropertyMetadata(Brushes.DarkGreen));