在 WPF/Surface 应用程序中托管 WPF/Surface 应用程序

发布于 2024-10-12 22:01:04 字数 646 浏览 6 评论 0原文

我正在尝试创建一个父 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

能怎样 2024-10-19 22:01:04

我首先会考虑使用 Microsoft Prism,特别是 Modularity 命名空间。

I would first look at using Microsoft Prism, specifically the Modularity namespace.

往事随风而去 2024-10-19 22:01:04

除了“不同的应用程序”部分之外,这听起来像是 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?

注定孤独终老 2024-10-19 22:01:04

我按照这个方法来解决这个问题。启动器本身并不托管应用程序,但会启动一个新应用程序并隐藏自身。

我遵循的步骤:

  1. 主启动器应用程序将在 Kiosk 模式下运行,即始终在顶部/没有通过捕获关闭事件来关闭的选项/任务栏中没有显示实例/没有标题栏/杀死 explorer.exe/隐藏任务栏。
  2. 启动器填充一个水平列表框(为 UI 模板化的数据),它可以占据屏幕的主要中心区域,并且可以以任意方式滚动。
  3. 当用户在列表框中选择一个项目时,单击/点击事件将启动一个单独的进程,并将启动器窗口的可见性设置为隐藏,并在列表框中创建一个小按钮(基本上是一个内部只有一个按钮且大小设置为按钮的高度/宽度的窗口)屏幕的任一角都有“始终位于顶部”选项。
  4. 按钮的功能是最小化当前正在工作的应用程序并将启动器的可见性设置回可见并将焦点设置到该窗口。
  5. 由于该进程是由启动器启动的,因此我捕获启动窗口的关闭事件,以了解用户结束了应用程序,然后再次弹出启动器。

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:

  1. The main launcher application will run in Kiosk mode i.e always on top/no option to close by capturing the close event/No instance shown in taskbar/no title bar/killing the explorer.exe/hiding the taskbar.
  2. The launcher populates a horizontal listbox (data templated for UI) which lets occupied main center area of screen and can be scrolled either ways.
  3. When user selected an item on listbox, click/tap event a separate process is launched with launcher window's visibility set to hidden and a small button(basically a window with just a button inside and size set to height/width of button) created on the either corner of the screen with always on top option.
  4. The functionality of button is to minimize the current working application and set visibility of launcher back to visible and setting the focus to this window.
  5. Since the process is launched by launcher, i trap the close event for the launched window to know user ended the application and then again pop up the launcher back.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文