Home > Articles > Programming > Windows Programming

  • Print
  • + Share This
From the author of Settings


This feature is a bonus for both developers and users. Have you ever installed a third-party product that hides user preferences in some arcane menu option buried several levels deep? It’s a frustrating experience, and many applications provide completely inconsistent ways to access user settings. Metro has changed this by providing a consistent way for users to access the context menu for an application where settings can be stored. The first step is simply registering for commands, which are a set of options the user is presented with when they swipe from the right side of the screen in a running application:

    += OnCommandsRequested;

The next step is to provide a command to open a settings menu:

void OnCommandsRequested(SettingsPane sender,
    SettingsPaneCommandsRequestedEventArgs args)
 var preferences =
     new SettingsCommand("preferences", "Preferences",
        (handler) =>
         var settings = new SettingsFlyout();
         settings.ShowFlyout(new PreferencesUserControl());

Your job is to create the class that performs the animation to cause the panel to animate from the right edge. After that, you can simply add various commands and implement the pages you need such as “About” and “Preferences.” This provides a very consistent experience to the end user with standard guidance for the developer.

  • + Share This
  • 🔖 Save To Your Account