Windows Universal App(Windows 10)的多个实例 [英] Multiple instances of a Windows Universal App (Windows 10)

查看:221
本文介绍了Windows Universal App(Windows 10)的多个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始为通用Windows平台(Windows 10)开发应用程序,并且正在制作需要能够在多个实例上运行的应用程序.我已经看到通用应用程序可以做到这一点,因为有些应用程序已经可以做到这一点(例如计算器,Edge).

I'm beginning to develop apps for the Universal Windows Platform (Windows 10), and I'm making an app that needs to be able to run on multiple instances. I've seen that this is possible with the universal apps as there are some apps that can already do this (e.g. Calculator, Edge).

我已经尝试在Google,Microsoft的API参考上进行搜索,但均无济于事.非常感谢您的帮助.

I have already tried searching on Google, on Microsoft's API reference, and here to no avail. I'd really appreciate your help.

推荐答案

UWP/商店应用程序不使用多实例,而使用多视图样式. (边缘是一个例外,也许...)

UWP/store apps use no multiinstance, but use multi-view style. (Edge is an exception, maybe...)

在多视图中,实例是相同的,但是每个窗口的视图"都在每个线程上运行.

In multi-view, the instance is same but each windows' 'Views' are running on each threads.

设计准则: 多个窗口的指南

示例: MultipleViews示例

[2018年2月添加]在Windows 10 RS4(1803)中,我们可以在UWP App中使用"true"多实例:)适用的设备系列为台式机和IoT.这是一种选择加入"选项-您需要在应用清单中声明它才能使用它.有关详细信息和示例,请访问下面的Microsoft Docs网站.

[Added Feb 2018] From Windows 10 RS4 (1803), we can use the 'true' multi instance with UWP App :) Applicable device families are Desktop and IoT. This is a sort of 'opt-in' option - you need to declare it on your application manifest to use it. The detail and samples available on the following Microsoft Docs site.

创建多实例通用Windows应用

[2017年6月添加]从build2017演示文稿开始,Microsoft似乎计划扩展其UWP App模型,以在未来的Windows Update中允许真正的多实例".但是详细信息尚不可用.

[Added June 2017] As of build2017 presentations, it seems that Microsoft have a plan to extend their UWP App model to allow the real "Multi Instance" by their future Update of Windows. But the details are not available yet.

[添加到2015年]我已经上传了示例

[Added 2015] I've uploaded the sample bogusCalc to my OneDrive.

这是基于VS2015空白"模板和ViewLifetimeControl.cs的,该模板是从多个视图示例中选取的.每次从开始菜单启动bogusCalc时,

This is based on VS2015 'blank' template and ViewLifetimeControl.cs, picked from multiple views sample. Each time you start the bogusCalc from the start menu, Application::OnLaunched is invoked.

这篇关于Windows Universal App(Windows 10)的多个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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