Use a WPF program to tune a UWP program

Source: Internet
Author: User
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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.