DDLG.MultiInstanceTrial - Microsoft Store
This post is part 2 of the series - UWP Multi Instance Support.
UWP App の Multi Instance サポート その１(in japanese)
To enable the multi instance, just update your Package.appxmanifest. 1) Update the namespace at "Package" element, and 2) Add attribute "SupportsMultipleInstances" to "Application" element.
Oh, at first, you need to use the Win10 1803 or later (and SDK).
- start - Package.appxmanifest
- end -
Behavior of Protocol Activation
If you register the app as protocol handler and the app is enabled as multi instance, the behavior is differ from the single instance. When the protocol activation happen, always new instance created. On single instance, same instance's OnActivate is called again.
It seems that each instances are running on same AppContainer. This means, each instances share the one LocalSettings/LocalFolder/Etc.
You can use my sample app to see the behavior. On the right side, you can show the image file. This file name is shared by LocalSettings, then each instances can use the same value.
In this trial, I'm using the most easiest way to share the event - ApplicationData.Current.DataChanged.
When you create or modify the applicationdata, the event signaled. You can also signal it manually.
Note - This event will be signaled with background thread. It's need to use dispatcher to use it with UI thread. You can see the sample on the source above.
Memory Mapped File
As of same app container, you can share the data by using memory mapped file. In my sample, the center pane use the one.
WinMR Environment - Desktop and MR
On WinMR enabled system, you can use both the windows desktop and WinMR 3D environment.
You can run your app on both. And, it seems that both share the same app container. By using this app, I could confirm that.