Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>May I ask how you are allowing the user to switch back and forth between the views? Is it a key combo? Mouseclick?</p> <p>Not that it's answering your question per se, but my suggestion is that this sounds like a perfect scenario for a tab control. And with WPF, it doesn't necessarily have to look anything like a tab control.</p> <p>If you use a TabControl, it opens up the possibility of using the SelectionChanged event coming off of the TabControl to allow you to tell background threads to stop and you can unload anything that you need to unload. </p> <p>Depending on how you use the TabControl, the UI can be somewhat virtualized. What that means is that whenever a tab is unselected all of the UI for that tab is destroyed and recreated the next time it's selected. It will behave this way if you use the <a href="http://msdn.microsoft.com/en-us/magazine/dd419663.aspx" rel="nofollow noreferrer">MVVM</a> or PresentationModel pattern and load ViewModels as the items for your TabControl and use DataTemplates for the views. If you just put TabItems into the TabControl with controls inside of them, it will not behave this way, however.</p> <p>As far as patterns are concerned, I'd definitely recommend <a href="http://msdn.microsoft.com/en-us/magazine/dd419663.aspx" rel="nofollow noreferrer">MVVM</a>. It may take a bit of time to catch up to it and understand it, but I'd never do WPF without it. If you need anymore resources or examples, let me know.</p> <p><strong>edit:</strong></p> <p>I reread your question and noticed that you may be in need of another type of navigation. If you've got views that are needing to make transitions to other views based on user actions and you don't want all of the views to be presented to the user so that they can select which one they want to look at (like the TabControl will do), you may want to look at <a href="http://msdn.microsoft.com/en-us/library/ms748811.aspx" rel="nofollow noreferrer">WPF Navigation</a>. Navigation is basically something that MS added in with WPF to allow browser style navigation in a WPF app. <a href="http://msdn.microsoft.com/en-us/library/ms748811.aspx" rel="nofollow noreferrer">This MSDN article</a> should be a good resource on that kind of thing.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload