gpt4 book ai didi

c# - 为 URI 关联注册应用程序 (Windows Phone 8.1 RT)

转载 作者:太空宇宙 更新时间:2023-11-03 19:56:47 25 4
gpt4 key购买 nike

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

最佳答案

您要查找的术语是协议(protocol)激活。可以看看官方Association launching sample .

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

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();
}

关于c# - 为 URI 关联注册应用程序 (Windows Phone 8.1 RT),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32755910/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com