2
votes

In my application I only need one view visible at a time which is why I am using a ContentControl in my shell. The issue is that if I have one view visible (lets say View1) and I activate View2, everything is fine up to this point. Now the user presses the Close button on View2 after which the users end up looking at a blank screen now since no views are active now. I suppose that the region adapter Deactivates the currently active view before activating the next view.

How can I ensure that the previously active view becomes Activated again (View1 from my example)? Do I need a different type of region to achieve this functionality?

Thanks in advance,

Ali

1

1 Answers

1
votes

Unfortunately (as you found out) this is not the behavior. You'll have to track your views and activate the previous one yourself.

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

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