Blockchains, Cloud & Development

Month: January 2013

While developing Windows 8 applications I have come across the requirement to have my list of items sorted on my screen, sometimes in a <ListBox>. Unfortunately the base WinRT controls make this really difficult to achieve.

After a few hours of searching for an easier way to do it, I finally discovered a way of sorting the items. Rather than having the controls automatically sort for me (as I was used to doing in Silverlight, etc.), but instead by sorting the underlying list itself. It makes total sense in hindsight.

But to sum the article up, if you even have the “can access the internet” capability checked then you MUST have a privacy policy. I (incorrectly) thought that since I was just accessing a XML feed and not sending any data that I would be excluded from the requirement. But Microsoft have no idea what you may be sending in your GET/POST requests.

The next hurdle is finding somewhere to host your privacy policy. You could use a free Windows Azure website account, post it onto your blog (like I have done), or perhaps put it onto skydrive/dropbox and make it public.

Code

Once you have your privacy policy, the last step is to add it to the settings charm. The easiest way is to add it to the settings charm from App.xaml.cs, this way the privacy policy is available on every page of your application.

Below I have included the code snippet I use in my own code. First you add an event handler for when the commands are requested. Then you add your new privacy policy option to the settings screen. Finally you add logic for what happens when your new option is clicked (launch the web browser).