WPF - Prism - activate and deactivate views in ContentControl

In my application, I only need one visible image at a time, so I am using ContentControl in my wrapper. The problem is that if I have one view (apparently View1) and I activate View2, everything is fine up to this point. Now the user clicks the Close button on View2, after which users are now looking at a blank screen as there are no active views now. I assume the region adapter Disables the currently active view before activating the next view.

How can I make sure that a previously active view is activated again (View1 from my example)? Do I need a different type of region to achieve this functionality?

Thanks in advance,

Ali

+2


source to share


1 answer


Unfortunately (as you learned) this is not behavior. You will need to track your views and activate the previous one.

Jeremiah commented and got me thinking about the behavior for this. I think the ActiveAware behavior is probably a good behavior model that would track and possibly act on active / inactive events.



Here is the source code for the ActiveAware behavior. You can use this model as a starting point for behavior that does what you want, I'm sure. http://compositewpf.codeplex.com/SourceControl/changeset/view/26112#496678

+1


source







All Articles