SettingsContractWrapper – the easy way to integrate w/ settings

In the previous post I introduced the Flyout control.

Now the most common use case for the Flyout controls is in the inegration with the settings contract.

Integrating with the settings contract is usually a two-step procedure. First you have to add a SettingsCommand to the charm and then attach a Flyout or similar to it. Now that you have a Flyout you could do that on your own, but with the SettingsContractWrapper it is even more fun.

To use it you  need to define one or more instances of SettingsEntry. This class holds the information required to set up the Flyout

Its constructor takes three arguments: Title, FlyoutDimension, Content.

The SettingsContractWrapper takes five arguments: Foreground, Background, Theme, Icon, SettingsEntries.

The required namespaces are ‘TCD.Controls’ and ‘TCD.Controls.Settings’.

As soon as you called the SettingsContractWrapper constructor you can forget about the settings contract integration. Just make sure that the UserControls you hand over to the SettingsEntries work well with the layout.

(There’s plenty of descriptions in the IntelliSense tooltips!)

Now download the FlyoutAndSettingsSample, or TCD.Controls from NuGet and give it a try yourself!

Feel free to contact me if you have any questions!

cheers =)

UPDATE: the sample application was updated to Windows 8 Release Preview =)

One comment

  1. Pingback: Flyout control for Windows 8 Metro (XAML/C#) « Kuchenzeit

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.