Easy way to add “Privacy Policy” to Windows Charm settings – Using C#/XAML


Under the ‘Content compliance’ category dev’s always get the following warning “Your app doesn’t meet requirement 4.1”. In other words that mean “The app has declared access to network capabilities and no privacy statement was provided in the Windows Settings Charm”

given below is the easy way of overcoming that 🙂

1. Add the “Callisto” Extension

go to Project -> Manage NuGet Packages -> Online -> Search for ‘Callisto’ and Install it.

cal

2. Creating Privacy Policy xaml page.

Create a new xaml page which is dedicated for Privacy Policy and add the following code.

<Grid>
<StackPanel Background="White">
<TextBlock Text="Privacy Policy" FontFamily="Segoe UI" FontWeight="SemiLight" FontSize="26.667" />
<TextBlock Text="The application does not collect any personal data of users and is for the sole purpose of delivering the requested information." FontFamily="Segoe UI" FontWeight="SemiLight" FontSize="18" TextWrapping="Wrap" AllowDrop="True" />
</StackPanel>
</Grid>

PS: Background color of this will be the background color of Privacy policy in Windows Charm

3. Adding reference

go to App.xaml.cs and add the following references

using Windows.UI.Popups;
using Callisto.Controls;
using Windows.UI;
using Windows.System;
using Windows.UI.ApplicationSettings;

4. Add the following field to the ‘App‘ class.

private Color _background = Color.FromArgb(255, 0, 77, 96);  

5. Add the following statements to the ‘OnLaunched’ method.

SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;  

6. Add the following event handler to ‘App.xaml.cs’

void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {

            var about = new SettingsCommand("privacy policy", "Privacy Policy", (handler) =>
            {
                var settings = new SettingsFlyout();
                settings.Content = new Privacy_Policy();
                settings.HeaderBrush = new SolidColorBrush(_background);
                settings.Background = new SolidColorBrush(_background);
                settings.HeaderText = "Privacy Policy";
                settings.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(about);
        }  

pp1

pp2

Now Debug your app and check Privacy Policy in the windows charm 😉

Advertisements

15 Comments

  1. Pingback: Things to consider before submitting Windows Store Apps | Just Random

  2. Pingback: Easy way to add “Privacy Policy” to Windows Charm settings – Using HTML/JavaScript | Just Random

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s