For a variety of reasons, I need to use a WPF program to tune a UWP program, summarize below and give yourself a backup.
The key to starting a UWP program is protocol startup
Add a protocol to our UWP app like this:
Then use the protocol to launch the UWP there are several ways:
1. Using the UWP launcher API
Create the URI to launch from a string.
var uri = new Uri ("ProtocolName:");
Launch the URI.
BOOL Success = await Windows.System.Launcher.LaunchUriAsync (URI);
Here's a question: How to use the UWP API in WPF, refer to the link:
2. Using Packagemanager, also the UWP API
var manager = new Packagemanager ();
var p = Manager. Findpackagesforuser ("", PackageId);
var ls = await p.tolist () [0]. Getapplistentriesasync ();
foreach (var item in LS)
//{
Await item. Launchasync ();
//}
Thanks for the vbfool of the great God!
One of the PackageID is the package series name (Packagefamilyname)
3. Use of Process.Start (new ProcessStartInfo ("ProtocolName:"));
4. Use the command line
Like:>start Myapplication:protocol-parameter, reference acceptance parameters
The link also describes another way: Start activation (command line arguments are not supported), not to repeat it here.
A few months of WPF discovery has forgotten the uwp stuff, eh, so weak chicken!