8.1的协议和wp8是相互通用的
被启动:
相比较wp8而言,基本变化不大,但添加方式更直观了
1:打开Package.appxmanifest
2:切换到"声明"选项卡
3:左侧添加"协议",右侧填写应用的属性
4:其中名称就是程序的识别码
5:App.cs中 override OnActivated,处理传入的参数
protected override void OnActivated(IActivatedEventArgs args) { if (args.Kind == ActivationKind.Protocol) { ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs; if (eventArgs.Uri.ToString() == "acfunwz:main") this.OnLaunched(null); // TODO: Handle URI activation // The received URI is eventArgs.Uri.AbsoluteUri } }
启动其他应用:
await Windows.System.Launcher.LaunchUriAsync(new Uri("acfunwz:main"));