Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Enabling and Disabling animations easily;

 
 
Old 11-11-2008   #1 (permalink)
WernerG


 
 

Enabling and Disabling animations easily;

I am trying to implement a way where I can easily enable and disable
animations via application configuration. I came up with the following
solution...

public class AnimationControl
{
.....#region const
.........public static bool enableAnimation = false;
.....#endregion

.....public static void Begin( UIElement target, DependencyProperty property,
AnimationTimeline timeline )
.....{
.........if ( enableAnimation )
.............target.BeginAnimation( property, timeline );
.........else
.........{
.............LocalValueEnumerator en = timeline.GetLocalValueEnumerator();
.............en.Reset();
.............while( en.MoveNext() )
.............{
.................if ( en.Current.Property.Name == "To" )
.....................target.SetValue( property, en.Current.Value );
.................}
.............}
.........}
.....}


This works fine. However, animations that have completed events associated
with them obviously wont work with this trick. Is there any way to manually
signal a AnimationTimeline to fire that event?

Thanks

W

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Enabling/disabling device on hardware profile Vista hardware & devices
running much faster after disabling and re-enabling aero... Vista General
everything faster after disabling and re-enabling aero... Vista General
Faster overall after disabling and re-enabling aero... Vista General
Faster overall after disabling and re-enabling aero... Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46