Use ColorAnimation to animate background : Color Animation « Windows Presentation Foundation « VB.Net Tutorial






<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

    
    <Button Background="Red" VerticalAlignment="Center" HorizontalAlignment="Center" Content="AAA">
      <Button.Triggers>
        <EventTrigger RoutedEvent="Button.Loaded">
          <BeginStoryboard>
            <Storyboard>
              <ParallelTimeline Duration="0:0:5">
                  
                <ColorAnimation BeginTime="0:0:2" Duration="0:0:1"
                                Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)"
                                From="Red" To="Yellow" AutoReverse="True"
                                RepeatBehavior="Forever" />
    
              </ParallelTimeline>
            </Storyboard>
          </BeginStoryboard>
        </EventTrigger>
      </Button.Triggers>
    </Button>


</Page>
WPF Use Color Animation To Animate Background








16.108.Color Animation
16.108.1.Animated GradientStop Offset with DoubleAnimationAnimated GradientStop Offset with DoubleAnimation
16.108.2.Animated GradientStop Color with ColorAnimationAnimated GradientStop Color with ColorAnimation
16.108.3.Animated GradientStop Opacity ColorAnimation.ByAnimated GradientStop Opacity ColorAnimation.By
16.108.4.Animated GradientOriginAnimated GradientOrigin
16.108.5.Animating ColorAnimating Color
16.108.6.Animating Gradient OffsetAnimating Gradient Offset
16.108.7.Animate GradientStopAnimate GradientStop
16.108.8.Opacity AnimationOpacity Animation
16.108.9.Animation LinearGradientBrushAnimation LinearGradientBrush
16.108.10.Use ColorAnimation to animate backgroundUse ColorAnimation to animate background