在 WPF/Surface 应用程序中托管 WPF/Surface 应用程序
我正在尝试创建一个父 WPF/Surface 应用程序,它将托管多个 WPF/Surface 应用程序。我正在寻找一些有关如何实现此类功能的指导。正在阅读 http://msdn.microsoft.com/en-us/library/ms742522 .aspx 但它讨论了在 WPF 中托管 Win32 内容,反之亦然。
我的想法是拥有类似于 MDI 表单的东西,其中您有一个主表单,并且可以实例化多个子表单。
就我而言,这些将是不同的应用程序,将使用配置文件启动并在主应用程序中加载。
另外,有没有办法确保主窗口的进程内存不被启动的子进程占用。
编辑: 主机应用程序将根据用户的选择启动不同的应用程序。可以说它就像一个基于 WPF/Surface touch SDK 构建的应用程序启动器。现在,一旦应用程序启动,启动器就会进入后台(除了显示小按钮以在稍后的某个时刻再次将其向前推进),并且当用户结束时,当前应用程序启动器将再次返回前台。我认为唯一必要的交互是知道启动的应用程序已终止或在有限的屏幕区域中调用应用程序。如果有人见过 Microsoft Surface 应用程序启动器,即使启动应用程序,也会有角落按钮将应用程序启动器带到前台。
I am trying to create a parent WPF/surface application which will host multiple WPF/surface applications. I am looking for some pointers of how to implement such functionality. Was reading http://msdn.microsoft.com/en-us/library/ms742522.aspx but it talks about hosting Win32 content in WPF and vice versa.
My idea is to have something similar to MDI forms where you have a main form and you can instantiate multiple child forms.
In my case, these would be different applications which will be launched using a config file and loaded within the main application.
Also, since is there a way to ensure that the main window's process memory is not hogged by the child process initiated.
Edit:
The host application will launch different applications based on what user selects. One can say its like an application launcher which are build on WPF/Surface touch SDK. Now once the application is launched the launcher goes in the background(except showing small button to bring it forward again at some point later) and when the user ends the current application launcher comes back again in foreground. The only interaction i feel which is necessary is knowing the launched application is terminated or invoking applications in a limited screen area. If someone has seen the Microsoft surface application launcher, even when the application is launched there are corner buttons which bring the app launcher to foreground.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我首先会考虑使用 Microsoft Prism,特别是 Modularity 命名空间。
I would first look at using Microsoft Prism, specifically the Modularity namespace.
除了“不同的应用程序”部分之外,这听起来像是 MVVM 的经典案例。这些“不同的应用程序”实际上是单独的应用程序,还是它们只是同一应用程序中的单独项目?这可以简化演示文稿的选择。
我想您仍然可以有一个名为“Host”的视图来呈现不同的应用程序。
当然,WPF 没有 MDI 的概念,但您可以打开多个非模式窗口。
这实际上取决于您所说的“托管”是什么意思。主窗口是否需要以某种方式处理其他应用程序和/或与其他应用程序交互,或者它只是其他应用程序的启动板?
Except for the "different applications" part, it sounds like a classic case for MVVM. Are these "different applications" actually separate applications, or could they simply be separate projects within the same application? That may simplify the choice of presentation.
I suppose you could still have a View called "Host" that presents a different app.
Of course, WPF doesn't have the concept of MDI, but you can open multiple, non-modal windows.
It really depends on what you mean by "hosting". Does the main window need to somehow handle and/or interact with the other applications, or is it just a launching pad for other applications?
我按照这个方法来解决这个问题。启动器本身并不托管应用程序,但会启动一个新应用程序并隐藏自身。
我遵循的步骤:
I followed this approach to solve this problem. The launcher was not hosting the application within itself but would launch a new application and hide itself.
Steps I followed: