title: WPF Caliburn.Micro - Best way to navigate in Single Window Application
body: <ol>
  <li>My history:</li>
  </ol>
  
  <p>I'm developing a WPF application, which will run in full screen on the touch screen. Navigation in my application can be done only by clicking a button on each page ("back" or "logout").</p>
  
  <p>This is not a Universal App, but it looks like.</p>
  
  <ol start="2">
  <li><p>Assumptions of the project:</p>
  
  <ul>
  <li>Application will run on full screen mode in Windows 7 on the touch screen.</li>
  <li>I'm using Caliburn.Micro MVVM framework.</li>
  </ul></li>
  <li><p>Problem and question: </p></li>
  </ol>
  
  <p>I've got 1 window and 3 UserControl (and ViewModels) <a href="https://i.stack.imgur.com/KbpLS.jpg" rel="nofollow noreferrer">Concept art</a></p>
  
  <pre><code> Window ShellView
       UserControl LoginView
       UserControl OrdersView
       UserControl OrderDetailView
  </code></pre>
  
  <p>When application starting, i'm set LoginView as default and load it by using CM Conductor ActivateItem method, but i don't know <strong>how to set another View from UserControl like LoginView</strong></p>
  
  <p>I have read: <a href="https://stackoverflow.com/questions/16545750/wpf-caliburn-micro-mvvm-navigation">this question</a> but this doesn't cover my case
  and <a href="https://stackoverflow.com/a/15722990/3984428">this answer</a> but it's to hard to understand for me.</p>
  
  <p>My ideas:</p>
  
  <ul>
  <li>make static method in ShellViewModel like:</li>
  </ul>
  
  <p>ShellViewModel</p>
  
  <pre><code>public static void setOrdersView() {
      ActivateItem(new OrdersViewModel());
      // Error : An object reference is required for the non-static field, method, or property 'Caliburn.Micro.ConductorBase&lt;object&gt;.ActivateItem(object)
  }
  ShellViewModel.setOrdersView();
  </code></pre>
  
  <ul>
  <li>make listener in ShellViewModel and send event from child ViewModel ( but now i don't know how to achieve it)</li>
  </ul>
  
  <p><strong>Question: What is the best way to handle navigation in this case?</strong></p>
  
  <ol start="4">
  <li>Application architecture: </li>
  </ol>
  
  <p>ShellView</p>
  
  <pre><code>&lt;Window&gt;
     &lt;ContentControl x:Name="ActiveItem" /&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>ShellViewModel </p>
  
  <pre><code>public class ShellViewModel : Conductor&lt;object&gt;, IShell
  {
  
      public ShellViewModel()
      {
          LoadDefault();
      }    
  
      public void LoadDefault()
      {
          ActivateItem(new LoginViewModel());
      }
  }
  </code></pre>
  
  <p>LoginView</p>
  
  <pre><code>&lt;UserControl&gt;
      &lt;Button x:Name="Login" /&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>LoginViewModel</p>
  
  <pre><code>public class LoginViewModel : PropertyChangedBase
  {
      public void Login() {
          if (LoginManager.Login("User", "Password")) {
              // How to redirect user to OrdersView?
          }
      }
  }
  </code></pre>