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