[英]Is it possible to redirect from one page in Project A to a page in Project B from within the same solution
I have two projects, Project A and Project B. Both are under same Solution. 我有两个项目,项目A和项目B.两个项目都在同一个解决方案下。 I want use a page of Project A in Project B. How to call that page from Project B. Thanks in advance.
我想在项目B中使用项目A的页面。如何从项目B调用该页面。提前感谢。
Its possible to acceess another solution forms you have 2 projects in the same solution. 它可以加入另一种解决方案,在同一解决方案中有2个项目。
To open a form from another project, you have to add a reference to that project. 要从另一个项目打开表单,您必须添加对该项目的引用。
In the first project, right-click on the References item in the Solution Explorer window. 在第一个项目中,右键单击“解决方案资源管理器”窗口中的“引用”项。
Select the Add Reference option. 选择“添加引用”选项。 Select the Projects tab and select the second project.
选择Projects选项卡,然后选择第二个项目。
Click OK. 单击确定。 Then, to access a form from the second project just use this:
然后,要从第二个项目访问表单,只需使用:
Yourproject2.FormsName objName=new YourProject2.FormName(); Yourproject2.FormsName objName = new YourProject2.FormName();
objName.Show(); objName.Show();
首先添加对您的其他项目的引用,然后只需调用:
NavigationService.Navigate(new ProjectB.page());
You need to add a reference to Project A in your Project B. You can do this by RMC on a ProjectB and choosing Add reference... . 您需要在项目B中添加对项目A的引用。您可以在ProjectB上通过RMC执行此操作并选择添加引用.... Then in a new window go to Projects tab and choose Project A. After that, you can call the page in Project B: Pseudo-code:
然后在新窗口中转到Projects选项卡并选择Project A.之后,您可以在Project B中调用页面:Pseudo-code:
ProjectA.PageNamespace page = new ProjectA.PageNamespace()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.