windows8 提交应用商店失败,需要添加隐私声明

windows8 提交应用商店失败,需要添加隐私声明,提示要添加隐私声明。于是在网上百度找到这篇文章。方法如下:

     在 App.xaml.cs 文件中,重写  OnWindowCreated(WindowCreatedEventArgs args) 方法,然后当用户

点击 “超级按钮” 上的设置时 (Windows 8 的设置操作),添加 “隐私声明” 的链接,点击后可以跳到网站的 “隐私声明” 页面:

protected override void OnWindowCreated(WindowCreatedEventArgs args)
        {
            SettingsPane.GetForCurrentView().CommandsRequested += onCommandsRequested;
           
            base.OnWindowCreated(args);
        }

        void onCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs eventArgs)
        {

            //表示处理在用户调用上下文菜单命令时引发的事件的回调函数。
            UICommandInvokedHandler handler = new UICommandInvokedHandler(onSettingsCommand);

            //创建表示设置项的设置命令对象。此设置命令可追加到 ApplicationCommands 矢量。
            SettingsCommand privacyStatement = new SettingsCommand("privacyStatement", "隐私政策", handler);

            //追加 SettingsCommand 对象,使这些对象可供 SettingsPane UI 使用。
            eventArgs.Request.ApplicationCommands.Add(privacyStatement);
                    
        }


        //当命令调用时
       async void onSettingsCommand(IUICommand command)
        {
            SettingsCommand settingsCommand = (SettingsCommand)command;

            if (settingsCommand.Id.ToString() == "privacyStatement")
            {
                Uri pageUri = new Uri("网站的隐私声明页面");
                await Windows.System.Launcher.LaunchUriAsync(pageUri);
            }
        }

转自: http://www.cnblogs.com/hebeiDGL/archive/2012/11/18/2775568.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值