[英]Starting another project within main project in a solution for windows phone
I dont know if this is the right approach or not. 我不知道这是否是正确的方法。 But I have created an empty solution in VS2010 and I have added 2 projects to this solution.
但是我在VS2010中创建了一个空解决方案,并且向该解决方案添加了2个项目。 The first project is a panaroma project, and second one is a normal project (both for windows phone).
第一个项目是Panaroma项目,第二个项目是正常项目(均适用于Windows Phone)。
For the panaroma project I have added an applciation bar and some items. 对于panaroma项目,我添加了一个应用栏和一些项目。 One of these items is called option and I want to open the second project so the user can set/change some options.
这些项目之一称为选项,我想打开第二个项目,以便用户可以设置/更改一些选项。
How does one calls another project withing the main project? 如何与主项目一起调用另一个项目?
private void Options_Click(object sender, EventArgs e)
{
//Start the project which is called Options
}
If what you want is just reuse run some code of your second project but in the context of ProjectA (basically as a library), you can just do AddReference in ProjectA to add a reference to project B and use the follwing line to navigate to a page defined in projectB: 如果您想要的只是重用,请运行第二个项目的一些代码,但要在ProjectA的上下文中(基本上是作为一个库),您可以在ProjectA中执行AddReference来添加对项目B的引用,并使用下面的代码行导航到在projectB中定义的页面:
NavigationService.Navigate(new Uri("/ProjectB;component/SettingsPage.xaml", UriKind.Relative));
If what you want is to start ProjectB as an external application than in windows phone 8 you can use Uri association . 如果要在Windows Phone 8中将ProjectB作为外部应用程序启动,则可以使用Uri关联 。 Please note this is available only for windows phone 8 and whichever data are saved in application ProjectB will not be accessible from ProjectA since windows phone application are sandbox.
请注意,这仅适用于Windows Phone 8,因为Windows Phone应用程序是沙箱,所以无法从ProjectA访问保存在应用程序ProjectB中的任何数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.