简体   繁体   English

切换两个WPF应用程序

[英]Switch two WPF Applications

I have two WPF Applications, for example, one is A_wpf application, the others is B_wpf application. 我有两个WPF应用程序,例如,一个是A_wpf应用程序,另一个是B_wpf应用程序。 There are one Button on each application. 每个应用程序上都有一个Button I want to Button in A_wpf application to Start up B_wpf application and show B_wpf with Maximized. 我想在A_wpf应用程序中单击Button来启动B_wpf应用程序,并使用Maximized显示B_wpf I want to Button in B_wpf application to do the same thing as A_wpf Application do. 我想ButtonB_wpf应用程序做同样的事情A_wpf应用做。

Could anyone give me any advices please? 有人可以给我任何建议吗?

You can use Process.Start(path_to_exe) : 您可以使用Process.Start(path_to_exe)

using System.Diagnostics;

//...

Process.Start(path_to_exe);

Now if you want to avoid opening another instance if the target application is already running, you coud use Mutex for that . 现在,如果要避免在目标应用程序已在运行的情况下打开另一个实例,则可以为此使用Mutex

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM