Share via


AccountsSettingsPane Class

Definition

Provides methods to show the accounts pane and also to enable the app to register callbacks when the accounts flyout is about to be displayed.

public ref class AccountsSettingsPane sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
class AccountsSettingsPane final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
public sealed class AccountsSettingsPane
Public NotInheritable Class AccountsSettingsPane
Inheritance
Object Platform::Object IInspectable AccountsSettingsPane
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

The app provides the callbacks with account metadata for all of the web account providers, web accounts, global account commands, and credential locker credentials that the app displays. Examples of account providers are Facebook, LinkedIn, and Twitter.

The account and credential command classes in the Windows.UI.ApplicationSettings namespace correspond with data objects in the Windows.UI.ApplicationSettings namespace:

Data Object (Windows.Security.Credentials) UI object (Windows.UI.ApplicationSettings)
WebAccount WebAccountCommand
WebAccountProvider WebAccountProviderCommand
PasswordCredential CredentialCommand

Desktop applications

For a desktop app, instead of using the AccountSettingsPane class, you'll need to use the interop API as described below.

The following is an example on how to use the AccountSettingsPaneInterop class in C# (.NET 6 or later):

private void LoginButton_Click(object sender, RoutedEventArgs e)
{
    // Retrieve the window handle for whichever UI framework being used (WinUI 3, WPF, WinForms)
    var hwnd = ...
    // Call methods from the interop class, passing in the window handle
    await AccountsSettingsPaneInterop.ShowManageAccountsForWindowAsync(hwnd);
}

Version history

Windows version SDK version Value added
1607 14393 ShowAddAccountAsync
1607 14393 ShowManageAccountsAsync
1803 17134 ShowAddAccountForUserAsync
1803 17134 ShowManageAccountsForUserAsync

Methods

GetForCurrentView()

Gets an AccountsSettingsPane object that is associated with the current app view (that is, with CoreWindow).

Show()

Displays the account settings pane.

ShowAddAccountAsync()

Displays the add accounts screen.

ShowAddAccountForUserAsync(User)

Displays the add accounts screen for the specified user.

ShowManageAccountsAsync()

Displays the manage accounts screen.

ShowManageAccountsForUserAsync(User)

Displays the manage accounts screen for the specified user.

Events

AccountCommandsRequested

Occurs when the user opens the accounts pane. Handling this event lets the app initialize the accounts commands and pause its UI until the user closes the pane.

Applies to

See also