4

I develop a library for WinPhone app. This library contains several screens.

If I would like to navigate to another view in the same project I can use code like this:

NavigationService.Navigate(new Uri("/NewTaskPage.xaml", UriKind.Relative));

How can I navigate to view from another (relative) project (my library for example)?

Thanks

Alex Klimashevsky
  • 2,457
  • 3
  • 26
  • 58

1 Answers1

3

Here is how you can do that:

NavigationService.Navigate(new Uri("/YOURPROJECTNAME;component/MainPage.xaml", UriKind.Relative));
Olivier Payen
  • 15,198
  • 7
  • 41
  • 70
  • I have the next error message:"No XAML was found at the location '/MYPROJECTNAME;View/MainPage.xaml'." Does it mean that I have to upload MYPROJECTNAME to phone? – Alex Klimashevsky Feb 04 '13 at 14:17
  • MYPROJECTNAME has to be replaced with the name of the project that contains the XAML. That project should be referenced in the main project references. – Olivier Payen Feb 04 '13 at 14:25
  • Well, I exactly do the same.I added the second project to project dependencies and added dll to references. May be something wrong with project properties? Because I think that resources (like xaml or images) dont copied to main project. – Alex Klimashevsky Feb 04 '13 at 14:33
  • I found my mistake. "component/" - is not a folder in project, it is a specific part of uri – Alex Klimashevsky Feb 04 '13 at 14:44