Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.98 KB

settingsflyout_backclick.md

File metadata and controls

44 lines (31 loc) · 1.98 KB
-api-id -api-type
E:Windows.UI.Xaml.Controls.SettingsFlyout.BackClick
winrt event

Windows.UI.Xaml.Controls.SettingsFlyout.BackClick

-description

Occurs when the user clicks the back button on a SettingsFlyout control.

-xaml-syntax

<SettingsFlyout BackClick="eventhandler"/>

-remarks

By default, clicking the back button on a SettingsFlyout control hides the control. Handle the BackClick event and set BackClickEventArgs.Handled to true to override this behavior and introduce your own logic.

This is useful when you have a SettingsFlyout that opens a second SettingsFlyout. By default, when the user taps the Back button on the second flyout, it will reopen the SettingsPane. You should handle the BackClick event and reopen the first flyout instead.

-examples

In this scenario, the Settings charm is used to open a SettingsFlyout that contains a list of accounts. When the user picks an account, a new SettingsFlyout is shown with options for the selected account.

Here, you handle the BackClick event of the second flyout so that when the user clicks the Back button, you show the account list again instead of the SettingsPane.

void AccountSettingsFlyout_BackClick(object sender, BackClickEventArgs e)
{
    e.Handled = true;
    AccountListSettingsFlyout accountList = new AccountListSettingsFlyout();
    accountList.Show();  
}

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

-see-also

BackClickEventArgs