title: WPF MVVM navigate views
body: <p>I have a WPF application with multiple views. I want to switch from view 1 to view 2 and from there I can switch to multiple views. So I want a button on view 1 that loads view2 in the same window.</p>
  
  <p>I tried those things, but can't get it to work.</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/9290269/mvvm-light-toolkit-galasoft-for-wpf-navigation-through-windows">How to navigate through windows with MVVM Light for WPF?</a></li>
  <li><a href="https://galasoft.ch/posts/2011/01/navigation-in-a-wp7-application-with-mvvm-light" rel="noreferrer">https://galasoft.ch/posts/2011/01/navigation-in-a-wp7-application-with-mvvm-light</a></li>
  </ul>
  
  <p>From the first link, the problem is that I don't understand the ViewModelLocator code. They call the <code>CreateMain();</code> function but where is this defined, and how can I switch to another view from inside a view.</p>