title: Navigating to a new page from the View Model in Windows Phone 8.1 universal app
body: <p>I am working on a windows phone 8.1 universal app and want to find the best way of handling page navigations without having large amounts of logic in the code behind. I want to keep the code behind in my View as uncluttered as possible. What is the accepted MVVM way of navigating to a new page in response to a button click?</p>
  
  <p>I currently have to send a RelayComnmand message from the ViewModel to the view with the details of the page to navigate to. This means that the code behind has to be wired up as follows:</p>
  
  <pre><code>    public MainPage()
      {
        InitializeComponent();
        Messenger.Default.Register&lt;OpenArticleMessage&gt;(this, (article) =&gt; ReceiveOpenArticleMessage(article));
  ...
  }
  
      private object ReceiveOpenArticleMessage(OpenArticleMessage article)
      {
       Frame.Navigate(typeof(ArticleView));
     }
  </code></pre>
  
  <p>This just doesn't seem the best way although it does work. How can I do the page navigations directly from the ViewModel? I am using MVVM-Light in my project.</p>