您的位置:首页 > 其它

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

2012-11-29 14:10 459 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Win8
相关文章推荐