Question

I have a UserControl that when loading it starts:

<Storyboard x:Key="StFlash" RepeatBehavior="Forever" AutoReverse="True" >
    <DoubleAnimation Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="img" From=".3" To="1" Duration="0:0:0.6">
        <DoubleAnimation.EasingFunction>
            <CircleEase EasingMode="EaseOut"/>
        </DoubleAnimation.EasingFunction>
    </DoubleAnimation>
</Storyboard>

Basically it makes an image blink forever. When I remove that user control should I worry about stopping the animation?

Was it helpful?

Solution

Yes, by possibility you must stop the Animation, because it will be played until the garbage collector does not destroy your UserControl, and it may take some time. For this purpose you may use the Unloaded event for UserControl.

For more information, see this link:

WPF Animations Tips and Tricks

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top