Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Maybe <a href="http://marlongrech.wordpress.com/2011/08/27/mefedmvvm-navigationextension/" rel="nofollow">this</a> link will help you. Just set the <code>NavigateTo</code> property to the view which you need to display on the window.</p> <p>As an example you can do something like </p> <pre><code>&lt;Window x:Class="MainWindowView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:meffed="http:\\www.codeplex.com\MEFedMVVM" meffed:ViewModelLocator.NonSharedViewModel="YourViewModel" WindowStartupLocation="CenterScreen"&gt; &lt;Button meffed:NavigationExtensions.NavigateTo="firstview" meffed:NavigationExtensions.NavigationHost="{Binding ElementName=_viewContainer}" meffed:NavigationExtensions.NavigateOnceLoaded="False" Visibility="Visible" /&gt; &lt;ContentControl x:Name="_viewContainer" Margin="0,0,0,10" /&gt; &lt;Window&gt; </code></pre> <p>Then the class file would be </p> <pre><code>public partial class MainWindowView : Window { public MainWindowView() { InitializeComponent(); } public ContentControl ViewContainer { get { return _viewContainer; } } } </code></pre> <p>Then you can define each view as <code>UserControl</code> and then using the link I gave above bind the button's <code>meffed:NavigationExtensions.NavigateTo="secondView"</code>. To target the <code>ContentControl</code> of the <code>Window</code> just use a <code>RelativeSource</code> binding. For e.g</p> <p><code>meffed:NavigationExtensions.NavigationHost="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}},Path=ViewContainer}"</code></p> <p>In each of the view just see that you annotate the code behind class definition with the <code>[NavigationView("firstview")]</code> and so on.</p> <p>It is complicated for first time but it will be very easy once you understand the idea.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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