如何重定向到特定项目中存在的页面到同一解决方案中其他项目中的另一个页面? [英] How to redirect to a page which exists in specif project to another page in other project in the same solution?
问题描述
我有 Windows 手机解决方案;其中包含两个 c# 项目.我在第一个项目的页面中有一个按钮;我们将用户重定向到第二个解决方案中的另一个页面.如何重定向到特定项目中存在的页面到同一解决方案中其他项目中的另一个页面?因为我们使用以下代码在同一个项目中的页面之间进行重定向.
I have windows phone solution ; which contain two c# projects. I have a button in one in the pages in the first project ; which we redirect the user to another page in the second solution. How to redirect to a page which exists in specif project to another page in other project in the same solution ? since we use the following code to redirect between the pages in the same project.
NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
推荐答案
如果是引用其他项目,可以使用以下方法:
If you are referencing the other project, you can use the following method:
NavigationService.Navigate(new Uri("/YourOtherProjectName;component/TargetPage.xaml", UriKind.Relative));
如果有人感兴趣,我在 Github 上放了一个示例项目:https://github.com/tpetrina/blogcode/tree/master/BlogResearch.WP7 应用程序项目称为 NavigateToLibraryPage,它包含一个按钮,可导航到名为 wp7.library
If anyone is interested, I've put a sample project on Github: https://github.com/tpetrina/blogcode/tree/master/BlogResearch. WP7 application project is called NavigateToLibraryPage and it contains a single button that navigates to the page in the referenced class library named wp7.library
这篇关于如何重定向到特定项目中存在的页面到同一解决方案中其他项目中的另一个页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!