Multiple instances of a Windows Universal App (Windows 10)

痴心易碎 提交于 2019-12-18 11:53:29

问题


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).

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


回答1:


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.

Design guideline: Guidelines for multiple windows

Sample: MultipleViews Sample

[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.

Create a multi-instance Universal Windows App


[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.


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

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.



来源:https://stackoverflow.com/questions/32807090/multiple-instances-of-a-windows-universal-app-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!