title: How to navigate to another project inside same solution
body: <p>Hey Hope somebody can help.</p>
  
  <p>I have in group developed on many different projects and we now want to combine these. I therefore include the projects.
  In the startup project I include the reference to the other projects.
  And then I use the code from another stackoverflow thread:</p>
  
  <p><a href="https://stackoverflow.com/questions/14685386/how-to-navigate-to-view-from-another-project">How to navigate to view from another project</a></p>
  
  <p>Which gives me the following</p>
  
  <pre><code>    NavigationService.Navigate(new Uri("/MVVMTestApp;/component/View/MainPage.xaml", UriKind.Relative));
  </code></pre>
  
  <p>The project builds and runs. But when I press the button that should activate the code I get an error after/during the execution of the line.</p>
  
  <p>The break error is located in the MainPage.g.cs file which looks like:</p>
  
  <pre><code>namespace MVVMTestApp {
  
  
  public partial class MainPage : Microsoft.Phone.Controls.PhoneApplicationPage {
  
      internal System.Windows.Controls.TextBlock MainPageTitle;
  
      internal System.Windows.Controls.TextBlock LEgE;
  
      private bool _contentLoaded;
  
      /// &lt;summary&gt;
      /// InitializeComponent
      /// &lt;/summary&gt;
      [System.Diagnostics.DebuggerNonUserCodeAttribute()]
      public void InitializeComponent() {
          if (_contentLoaded) {
              return;
          }
          _contentLoaded = true;
          *******System.Windows.Application.LoadComponent(this, new System.Uri("/MVVMTestApp;component/View/MainPage.xaml", System.UriKind.Relative));**
          this.MainPageTitle = ((System.Windows.Controls.TextBlock)(this.FindName("MainPageTitle")));
          this.LEgE = ((System.Windows.Controls.TextBlock)(this.FindName("LEgE")));
      }
  }
  }
  </code></pre>
  
  <p>The line where I inserted the stars, is where it breaks. What do I need to do to make it work?</p>
  
  <p><strong>Extra</strong></p>
  
  <p>As told in the comments, I need to include a forwardslash "/" before component, which is odd since it is not used in any place, else like the link above and this link</p>
  
  <p><a href="http://www.geekchamp.com/tips/wp7-navigating-to-a-page-in-different-assembly" rel="nofollow noreferrer">http://www.geekchamp.com/tips/wp7-navigating-to-a-page-in-different-assembly</a></p>
  
  <p>But including the forwardslash I get an error that there does not exist any xaml file where I point.
  Excluding the forwardslash and I get a XamlParseException occured....</p>
  
  <p>So I still have the problem of navigating to a view in another project.</p>
  
  <p><strong>ODD</strong></p>
  
  <p>I now do not have to have the leading forwardslash before component. As long as I write MVVMTestAppAssembly. I have looked in the assembly files and cannot find this included =?</p>
  
  <p>I tried it out after looking at msdn
  <a href="http://msdn.microsoft.com/en-us/library/cc296240%28v=vs.95%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/cc296240%28v=vs.95%29.aspx</a></p>
  
  <p>But still no luck, with getting the navigation to work</p>
  
  <p><strong>OVerview of reference and included the full path to the elements</strong>
  <img src="https://i.stack.imgur.com/pBM6e.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/vZhVA.png" alt="enter image description here"></p>
  
  <p><strong>One Solution</strong>
  As stated in one answer one solution is to use the windows phone class library. But when I use MVVM structure, I cannot get the viewmodelLocator to work. Therefore, this is not a solution for me.</p>
  
  <p>But if you use MVVM, I need another solution. Hopefully somebody has an idea for this.
  <strong>Another solution</strong>
  As stated below in an answer you can use the following
  Solution 1:</p>
  
  <p>You use the same type of projects "Windows Phone App". In the solution you need to have one Windows Phone App project and other projects should be of type Windows Phone Class Library.</p>
  
  <p>Then you can navigate to view in another project inside same solution with this line of code:</p>
  
  <pre><code>    NavigationService.Navigate(new Uri("/MVVMTestApp;/component/View/MainPage.xaml", UriKind.Relative));
  </code></pre>
  
  <p>To navigate between projects. However you get an error in the generated xaml file FILENAME.g.cs where it inserts the line loadcomponent. The error occurs because of the view being connected by datacontext to a viewmodel, as far as I can understand. And I have not been able to solve it.</p>
  
  <p>Hopfully somebody has a solution for this?</p>