This documentation is archived and is not being maintained.

How to: Animate a Glow Effect

This topic describes how to animate the GlowSize property of an OuterGlowBitmapEffect.

The following example animates changes to the GlowSize property of the OuterGlowBitmapEffect. As a result, the glow animates outward when the TextBox gets focus.

<Page xmlns=""
  xmlns:x="" >


    <TextBox Width="200">

        <!-- This BitmapEffect is targeted by the animation. -->
        <OuterGlowBitmapEffect x:Name="myOuterGlowBitmapEffect"  
         GlowColor="Blue" GlowSize="0" />

        <EventTrigger RoutedEvent="TextBox.GotFocus">

              <!-- Animate the GlowSize from 0 to 40 over half a second. --> 
                From="0" To="40" Duration="0:0:0.5" />



For the complete sample, see Bitmap Effects Gallery Sample.