Post headline image

XamlEssentials 3.6 Released, Plus What's New Since v3.3!

It's been a while since I've talked about XamlEssentials, and we've put out a few versions since then (including version 3.6 just a few minutes ago). So I thought I'd take a minute and talk about what has changed since the last time around.

  • Disabling Screenshots (new in 3.6!) - A few days ago, Pedro Lamas posted a great tip on how to disable screenshot in Windows Phone 8 GDR2 and later. As soon as I read it, I immediately saw how useful it would be as an Attached Property, so you could set the value in XAML. So I made some architectural changes, and adapted it to the OS detection methods already in XamlEssentials. Our version differs in that you don't have to check to see if you CAN access the required property, because it behaves just as you expect on GDR1 and earlier, without throwing exceptions. I also modified it so you can call DisplayHelper.ScreenCaptureEnabled="False" in XAML, or this.DisableScreenshots() from the codebehind, and you'd be good to go. The example app ships with screenshots disabled on the main page, so just run it on your phone and try to take a screenshot.
  • ResourceHelper (new in 3.5!) - As part of our ongoing development with our next round of products and services, we needed a way to be able to add ResourceDictionaries to an app programmatically. So we refactored some of the Phablet helper utilities in DisplayHelper into a new ResourceHelper, and added a new ResourceHelper.AddStyle() method. But don't worry, the old Displayhelper stubs are still there for compatibility.
  • BetaExperienceHelper (new in 3.4!) - Microsoft recently stopped adding a 90-day expiration period to Beta application submissions, allowing for continuous beta programs. So I whipped up a quick helper that lets you expire beta versions yourself. Technically, you can expire any app, since this does not rely on the IsBeta flag being set in WMAppManifest.xml. However, you can use the Flag in conjunction with the helper to make sure beta apps released to the store expire at your command.
  • EncryptionHelper (new in 3.4!) - There are some pretty significant differences in the encryption APIs between Windows Phone 8 and Windows 8. Fortunately Jan Hannemann worked out those differences, and contributed the EncryptionHelper to XamlEssentials. Through this helper, a string encrypted on Windows Phone can be decrypted on Windows 8, and vice-versa. It's a must have for storing sensitive information!
  • FrameworkElement.UpdateSource() (new in 3.4!) - This extension was contributed by Sanjay Sharma, and allows you to manually update the bindings for a given DependencyProperty. So instead of a two-way binding where the object is dirty immediately, you can wait to update your backing object until you've validated the inputs. This handy extension method is available for all XAML platforms.
  • ApplicationInfoHelper (updated in 3.4) - We added the ProductId, PublisherId, and IsBeta properties to the Windows Phone 8 version.
  • StoredItem<T> (updated in 3.4) We improved the stability of the StoredItem object in 3.4, and added a ForceSave() method to make sure that the contents can be flushed to IsolatedStorage whenever you want.
  • StatsHelper (updated in 3.5) - We made some adjustments to the StatsHelper to call the aforementioned ForceSave method when the application is terminated. This tackles a bug where the stats were occasionally not saved on app shutdown.

That about does it... quite a lot of features in the last few months. If you have any more tips or tricks for Windows 8 / Windows Phone 8 platforms, send us a pull request and we'll include them in the next release!