In a data entry form (Silverlight 3) I have one combo box whose selection can be changed when the user changes another - imagine a State list being repopulated depending on Country selection.
I want to highlight the change in this combo box with a simple glowing halo effect - basically a border that fades in then out again. I've created this simply using a Storyboard and Rectangle behind the control, but am sure there must be a better way of doing it - ideally something reusable.
Here's what I have:
<Rectangle x:Name="canvas" Height="24" Margin="98,58,79,0"
VerticalAlignment="Top" Width="169" Fill="#763DE4E4"
Canvas.ZIndex="1" Opacity="0" RadiusX="5" RadiusY="5"/>
<controls:ChildWindow.Resources>
<Storyboard x:Name="HighlightControl">
<DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="canvas"
Storyboard.TargetProperty="(UIElement.Opacity)" From="0" To="1"
AutoReverse="True" Duration="0:0:1" />
</Storyboard>
</controls:ChildWindow.Resources>
To use this effect on more than one control I currently have to reposition the rectangle and reset the Storyboard, or maintain a whole bunch of the rectangles and retarget the Storyboard.
I considered using a Border control and adding it to the control but this causes the Combo to move to accomodate the border - it needs to stay still with the halo glowing around it.
Update: It appears that the Blur effect can do the visible effect bit, which is fine - this is nicer than a side-by-side rectangle, so I'm just missing the reusable effect + animation bit. I wonder if this is what Behaviours are for?