Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 2.99 KB

settingsflyout_show_392493604.md

File metadata and controls

51 lines (39 loc) · 2.99 KB
-api-id -api-type
M:Windows.UI.Xaml.Controls.SettingsFlyout.Show
winrt method

Windows.UI.Xaml.Controls.SettingsFlyout.Show

-description

Opens the Settings flyout, and returns the user to the Settings pane after the flyout is dismissed.

-remarks

If a SettingsFlyout is shown by calling the Show method, then clicking the Back button reopens the SettingsPane after the SettingsFlyout dismisses. If a SettingsFlyout is shown by calling ShowIndependent, then clicking the Back button dismisses the SettingsFlyout and returns the user to the app; the SettingsPane is not reopened.

Call the Show method in your CommandsRequested event handler. This code is invoked when the user opens the SettingsFlyout from the SettingsPane, so you should return the user to the SettingsPane when they click the Back button.

Only one SettingsFlyout is shown at a time. Calling Show on a SettingsFlyout closes any other SettingsFlyout currently shown. The SettingsFlyout being closed completes its close animation before the new SettingsFlyout begins its show animation.

-examples

private void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
    // Add update settings.
    Windows.UI.ApplicationSettings.SettingsCommand updateSetting =
        new Windows.UI.ApplicationSettings.SettingsCommand("AppUpdateSettings", "App updates", (handler) =>
        {
            UpdateSettingsFlyout updatesFlyout = new UpdateSettingsFlyout();
            updatesFlyout.Show();
        });

    args.Request.ApplicationCommands.Add(updateSetting);

    // Add account list.
    Windows.UI.ApplicationSettings.SettingsCommand accountListSetting =
        new Windows.UI.ApplicationSettings.SettingsCommand("AppAccountListSettings", "Accounts", (handler) =>
        {
            AccountListSettingsFlyout accountsListFlyout = new AccountListSettingsFlyout();
            accountsListFlyout.Show();
        });
   
    args.Request.ApplicationCommands.Add(accountListSetting);
}

For more code in context, see Scenario 3 of the App settings sample.

-see-also

ShowIndependent, Quickstart: Add app settings, Quickstart: Add app help