c# - 隐私声明 Windows 8 Charm 设置

标签 c# windows-store-apps

<分区>

我的 Windows Store App 认证失败,测试人员给我的提示是:

"The app has declared access to network capabilities and no privacy statement was provided in the Windows Settings Charm".

谁能给我解决这个问题的确切代码。

最佳答案

在您的基本页面(或单独的页面,如果您只想在一个页面上),您可以这样定义设置:

SettingsPane.GetForCurrentView().CommandsRequested += SettingsCommandsRequested;

private void SettingsCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
    //use "new Guid()" instead of string "privacy" if you're experiencing an exception
    var privacyStatement = new SettingsCommand("privacy", "Privacy Statement", 
            async x => await Launcher.LaunchUriAsync(new Uri("http://some-url.com")));

    args.Request.ApplicationCommands.Clear();
    args.Request.ApplicationCommands.Add(privacyStatement);
}

很明显,在这个例子中,我们有指向外部页面的隐私政策链接,但是如果需要,您可以修改代码以在应用程序中打开一个单独的页面。

关于c# - 隐私声明 Windows 8 Charm 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13055381/

相关文章:

c# - 如何判断我的应用程序是作为 32 位还是 64 位应用程序运行?

c# - 使用 C# 自定义配置

c# - 如何修剪字节数组的几个字节?

javascript - winjs应用程序中的导航问题

c# - Windows 应用商店应用中的应用内购买问题

c# - Assembly.GetType 返回 null

c# - 如何将 byte[] 从 C# 作为字符串传递给 SQL Server 存储过程并转换为 varbinary(MAX)

windows-8 - 为 Windows 8 开发 Top AppBar

c# - Xaml C# 中 Windows 8 商店应用程序的游戏循环

c# - 写文件时App崩溃或关闭怎么办?