Transition Element unloads new content

Nov 9, 2009 at 9:24 AM
Edited Nov 9, 2009 at 9:37 AM

I created Templated Frame control with transition element within.


Unload happens after new content is shown? Remove TransitionElement from template and Unload doesn't happens..

Transitions are working ok, and new content is visible and stays visible but with unloaded event fired..

This is a big problem for me ...






Mar 1, 2010 at 2:14 PM
Edited Mar 2, 2010 at 6:09 AM

Yeah, I experienced this too, as a kludgy workaround I have my content implement an interface named ITransitionalsAware with a bool property named IsTranstionalsTransitionStarted, and on the OnContentChanged override of my custom control  I check if newcontent args implements this interface and caste it to it and set the IsTranstionalsTransitionStarted on newcontent to true, then in the unloaded event of the content I check for this value and set it to false, in the else clause I do my normal unloaded event handling.

Edit: In WPF another way to check to make sure it's a true unload is by checking the view's IsVisible property, if it's true than the view is still loaded.

if (IsVisible)