Trigger on Region.Add

Jan 19, 2009 at 4:35 AM
I'm curious if there is a story that I'm missing in the RegionManager that would support triggers/animations upon adding or removing Views from a Region.  I'm asking based trying to implement a slide-in of the next named view to be added to a Region.

I can deal with things on my own if I need, but didn't know if I was missing something.
Jan 19, 2009 at 2:13 PM
My limited understanding is that this is indeed possible, and I intend on doing it some day.
Jan 19, 2009 at 2:15 PM
Can you elaborate on how?

Jan 19, 2009 at 3:28 PM
Mind you, I'm certainly not a WPF expert, and this is totally off the cuff, and since I haven't attempted it yet, it's all theoretical but I imagine it can be achieved somehow like this:

If you take an already implemented region adapter for say an ItemsControl, then perhaps there are events there that you can hook up to in the underlying view, particularly for before the selection of an item takes place.  If you set a hook on that event which begins some sort of storyboard, then perhaps you can get somewhere from there...

Now that I think of it, if you were to develop a control which behaved the way you are suggesting, then I am imagining that you could simply get away with using that control (and possibly a custom region adapter) and assigning the region name attribute to it.  I'm imagining the TabControl for xample.  Now, I don't know squat about anything, but my limited understanding has me believing that I could somehow change the control templatefor the TabControl such that when a tab is switched, animations take place on opacity properties and there might be some way to get a fade/in/fade out effect.  So, the TabControl is treated like it has always been in CAL and regions/etc. but you just need to give it a different control template.

Also, have you looked at 3rd Party Components?  I know that genius Josh Smith recently open-sourced a region adapter for some Infragistics control.  I haven't demo'd the Infragistics suite for whatever reason, but they are supposed to be pretty good and they might have animations during transitions of dockable windows or something.

Best of luck mate!