为 URI 关联注册应用程序 (Windows Phone 8.1 RT)
Register app for a URI association (Windows Phone 8.1 RT)
您好,我想创建一个方案 URI 以从另一个应用程序启动我的应用程序。
我搜索了很多,我找到了这个教程 URI associations,它展示了如何为 A URI 关联注册你的应用程序,但它是针对 Windows Phone 8. 我正在开发一个应用程序 Windows Phone 8.1 RT 和 none 我找到的教程有效。至少我想知道 WP 8.1 RT 是否支持它。
您要找的词是协议激活。你可以看看官方Association launching sample.
简而言之:您在 appxmanifest 中配置协议并在 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();
}
您好,我想创建一个方案 URI 以从另一个应用程序启动我的应用程序。 我搜索了很多,我找到了这个教程 URI associations,它展示了如何为 A URI 关联注册你的应用程序,但它是针对 Windows Phone 8. 我正在开发一个应用程序 Windows Phone 8.1 RT 和 none 我找到的教程有效。至少我想知道 WP 8.1 RT 是否支持它。
您要找的词是协议激活。你可以看看官方Association launching sample.
简而言之:您在 appxmanifest 中配置协议并在 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();
}