Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your instincts are good: you <em>don't</em> want to put everything in one Window. You would be far better off putting each of the 15 "screens" in its own XAML file, as either user controls, or pages.</p> <p>If Web-browser-style navigation would make sense for your application, then look at the <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.page.aspx" rel="noreferrer">Page</a> class. If you set your Application's <a href="http://msdn.microsoft.com/en-us/library/system.windows.application.startupuri.aspx" rel="noreferrer">StartupUri</a> to point to a Page (instead of a Window), then you'll automatically get a window with Back and Forward buttons, and you can use <a href="http://msdn.microsoft.com/en-us/library/system.windows.documents.hyperlink.aspx" rel="noreferrer">Hyperlink</a>s (set the <a href="http://msdn.microsoft.com/en-us/library/system.windows.documents.hyperlink.navigateuri.aspx" rel="noreferrer">NavigateUri</a> property to point to another Page) or the methods of <a href="http://msdn.microsoft.com/en-us/library/system.windows.navigation.navigationservice.aspx" rel="noreferrer">NavigationService</a> to navigate to new pages.</p> <p>If you don't want the Back and Forward buttons, then put each "screen" in its own <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.usercontrol.aspx" rel="noreferrer">UserControl</a>, and add some minimal logic to the main Window to show and hide them. Or if you're using <a href="http://msdn.microsoft.com/en-us/magazine/dd419663.aspx" rel="noreferrer">MVVM</a>, you could set up some magic where you just change your Window's <a href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.datacontext.aspx" rel="noreferrer">DataContext</a> (or better yet, a property on your application-level ViewModel) and it automatically loads and shows the correct UserControl (look into <a href="http://msdn.microsoft.com/en-us/library/system.windows.datatemplate.aspx" rel="noreferrer">DataTemplate</a>s, or watch the video below).</p> <p>I would also strongly recommend that you use MVVM to try to write as little codebehind as possible (ideally none at all -- not always achievable, but you'll learn a lot by trying). That makes your XAML <em>tons</em> easier to refactor. If you later decide that one of your Grids has way too much stuff on it, you can just cut and paste it into a new UserControl, without needing to spend tons of time disentangling all the codebehind.</p> <p>Since it sounds like you're not familiar with the MVVM pattern, this video might go over your head, but I can't help recommending the MIX2010 talk "<a href="http://live.visitmix.com/MIX10/Sessions/EX15" rel="noreferrer">Build Your Own MVVM Framework</a>". It's an eye-opener on what MVVM can do, and has some solid ideas on how to manage navigation between different UserControls. (It also has a link to an intro-to-MVVM talk.)</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