Example of transition between control states

May 26, 2009 at 9:50 AM

The effects and transitions library is a great start and the example application useful to find out how to use the shaders.  But I think the missing functionality is to show how effects can be used to transition between two states of a control or between two sets of content. There are posts here asking questions about how to do this.  An example is a transition between the different content displayed by different pages of a tab control.  The example transitions assume the items being transitioned are or can be coerced to brushes. 

This link takes you to my implementation of a 'TransitionEffectElement' and an example you can run to see the effect.  The element is the result of experimenting with the transition effects so the code isn't great but may save a bit of time if you need the effect.  It works by looking for changes to its 'Content' dependency property and transitions between the old and the new content by generating a visual brush from the 'old' content then calling a transition effect's BeginAnimation method so it will paint from the old scene to the new scene.  The example project shows how you can specify a default transition effect or specify an effect for each content that will be transitioned.