I have a XAML page in a separate Windows Phone class library. The library is included in my VS solution and referenced from my app project. Let’s say the page is called TestPage.xaml and it’s in the root folder of my library called SharedPages.
I’d like to navigate to this page in my app using the NavigationService. I found this post which suggests using this URI format:
/{assemblyName};component/{pathToResource}
So I’m trying something like this:
NavigationService.Navigate(new Uri("/SharedPages;component/TestPage.xaml"));
When I run this I get the following exception:
Navigation is only supported to relative URIs that are fragments, or begin with ‘/’, or which contain ‘;component/’.
What am I doing wrong?
Thanks.
Looks like the URI needs to be created as a relative URI. This works: