为 URI 关联注册应用程序 (Windows Phone 8.1 RT) [英] Register app for a URI association (Windows Phone 8.1 RT)

查看:32
本文介绍了为 URI 关联注册应用程序 (Windows Phone 8.1 RT)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想创建一个方案 URI 以从另一个应用程序启动我的应用程序.我搜索了很多,我找到了这个教程 URI 关联,它显示了如何为 URI 关联注册您的应用程序,但它适用于 Windows Phone 8.我正在为 Windows Phone 8.1 RT 开发应用程序,但我发现没有一个教程有效.至少我想知道 WP 8.1 RT 是否支持它.

Hello i want to create a scheme URI to launch my app from another app. I searched a lot, i found this tutorial URI associations, it shows how to register your app for A URI association but it is for Windows Phone 8. I am developing an app for Windows Phone 8.1 RT and none of the tutorials i found work. At least I'd like to know if it is supported on WP 8.1 RT.

推荐答案

您正在寻找的术语是协议激活.您可以查看官方协会启动示例.

The term you're looking for is protocol activation. You can have a look at the official Association launching sample.

简而言之:您在 appxmanifest 中配置您的协议并在您的 App.xaml.cs 代码中处理激活.

In short: you configure your protocol in your appxmanifest and handle activation in you App.xaml.cs code behind.

protected override void OnActivated(IActivatedEventArgs args)
{
    if (args.Kind == ActivationKind.Protocol)
    {
        ProtocolActivatedEventArgs protocolArgs =
           args as ProtocolActivatedEventArgs;
        var rootFrame = new Frame();
        rootFrame.Navigate(typeof(BlogItems), args);
        Window.Current.Content = rootFrame;
    }
    Window.Current.Activate();
}

这篇关于为 URI 关联注册应用程序 (Windows Phone 8.1 RT)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆