WPF vs. Silverlight - Part 4 - Animations

See intro blogpost here.

If you want to work with animations programmatically, and modify them as they run, WPF requires you to start and stop the animation with a few extra parameters, to prevent them from being "frozen". Silverlight doesn't freeze elements, so this is not necessary there.

#if SILVERLIGHT 
    myStoryboard.Begin(); 
    myStoryboard.Stop(); 
#else 
    myStoryboard.Begin(element, true); //true allows for changing animation later
     myStoryboard.Stop(element); //element parameter required when Begin was called with element
#endif

Next: WPF vs. Silverlight - Part 5 - XAML Control Instantiation

Pingbacks and trackbacks (1)+

Add comment