【发布时间】:2011-06-26 12:51:32
【问题描述】:
我在单独的 Windows Phone 类库中有一个 XAML 页面。该库包含在我的 VS 解决方案中,并从我的应用项目中引用。假设该页面名为 TestPage.xaml,它位于我的名为 SharedPages 的库的根文件夹中。
我想使用 NavigationService 在我的应用中导航到此页面。我发现 this post 建议使用这种 URI 格式:
/{assemblyName};component/{pathToResource}
所以我正在尝试这样的事情:
NavigationService.Navigate(new Uri("/SharedPages;component/TestPage.xaml"));
当我运行它时,我得到以下异常:
仅支持对作为片段、或以“/”开头或包含“;component/”的相对 URI 进行导航。
我做错了什么?
谢谢。
【问题讨论】:
标签: silverlight windows-phone-7 navigation