关于两个项目 [英] Regarding two projects

查看:56
本文介绍了关于两个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个项目Project 1(P1)和Project2(P2)。   P1具有UI部分,P2具有逻辑部分。 P1上有一个按钮。在
按钮的单击事件将出现逻辑(在P2中)。我已将P2(.csproj)添加到P1中。如何将P2的逻辑/ P2.csproj链接到P1的按钮单击事件。代码是XAML代码。


推荐答案

双击P1的按钮(让它命名为"B1"),这将创建一个点击事件(让我们调用函数"click")并自动重定向到.cs文件中事件所在的部分创建。只需复制粘贴此部分P2中的逻辑,即可完成
。只要单击按钮,此粘贴代码就会运行。或者,如果您不想粘贴它,只需在项目中包含.cs文件,然后在"点击"按钮中调用您想要的功能。功能。

Double click on button (lets name it "B1") of P1, this will create a click event (lets call the function "click") and automatically redirect to the portion of .cs file where the event is created. Simply copy paste the logic from P2 in this portion and you are done. This pasted code will run whenever the button is clicked. Or if you don't want to paste it, just include the .cs file in your project and call the function you want in "click" function.

希望这有帮助


这篇关于关于两个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆