My primary concern here is to know how to launch another instance of my UWP app from the same app itself, some code snippet or documentation link would be helpful.
Below are the changes suggested by different links, but didn't found any thing concrete:
Appraoch:
Research suggest that we can launch multiple instance of the same UWP application by setting the package.appxmanifest
file with flag SupportsMultiInstances
to True
. Link here
<Application Id="App"
...
desktop4:SupportsMultipleInstances="true"
iot2:SupportsMultipleInstances="true">
...
</Application>
Extension
We can set the uap:FileTypeAssociation
for these apps and later run the instance of the app which we wish. But these are already build files and I need to open new instance at runtime from my uwp app.
URI:
One more way was to open store app using URI.
var uriToLaunch = "testapp-mainpage://";
var uri = new Uri(uriToLaunch);
bool success = await Windows.System.Launcher.LaunchUriAsync(uri);
Now based on this, the way I wish to launch second or another instance of my app is something like below:
Suppose I have an UWP app which have first view to select type of user from dropdown having Agent, Owner and GuestUser. based on that I show list of House properties to user on next page.
Now I would like to have the functionality where, when user press and hold on a house property card then the details to purchase it and other booking page(s) are visible on another instance(where selecting the type of user and selecting the house property is skipped). while if user just click once (not long-press) on a house property card then it will open in the same instance.
SideNote
I am not looking for MultipleView where we show independent part of your app in separate window.