AccountsSettingsPane クラス

定義

アカウント ウィンドウを表示するメソッドと、アカウントポップアップが表示されるときにアプリがコールバックを登録できるようにするメソッドを提供します。

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
継承
Object Platform::Object IInspectable AccountsSettingsPane
属性

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

注釈

アプリは、すべての Web アカウント プロバイダー、Web アカウント、グローバル アカウント コマンド、およびアプリに表示される資格情報ロッカー資格情報のアカウント メタデータをコールバックに提供します。 アカウント プロバイダーの例としては、Facebook、LinkedIn、Twitter があります。

Windows.UI.ApplicationSettings 名前空間のアカウントと資格情報のコマンド クラスは、Windows.UI.ApplicationSettings 名前空間のデータ オブジェクトに対応しています。

Data オブジェクト (Windows.Security.Credentials) UI オブジェクト (Windows.UI.ApplicationSettings)
WebAccount WebAccountCommand
WebAccountProvider WebAccountProviderCommand
PasswordCredential CredentialCommand

デスクトップ アプリケーション

デスクトップ アプリの場合は、 AccountSettingsPane クラスを使用する代わりに、以下で説明するように相互運用 API を使用する必要があります。

C# (.NET 6 以降) で AccountSettingsPaneInterop クラスを使用する方法の例を次に示します。

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);
}

バージョン履歴

Windows のバージョン SDK バージョン 追加された値
1607 14393 ShowAddAccountAsync
1607 14393 ShowManageAccountsAsync
1803 17134 ShowAddAccountForUserAsync
1803 17134 ShowManageAccountsForUserAsync

メソッド

GetForCurrentView()

現在のアプリ ビュー (つまり CoreWindow) に関連付けられている AccountsSettingsPane オブジェクトを取得します。

Show()

アカウント設定ウィンドウを表示します。

ShowAddAccountAsync()

[アカウントの追加] 画面が表示されます。

ShowAddAccountForUserAsync(User)

指定したユーザーの [アカウントの追加] 画面を表示します。

ShowManageAccountsAsync()

[アカウントの管理] 画面が表示されます。

ShowManageAccountsForUserAsync(User)

指定したユーザーの [アカウントの管理] 画面を表示します。

イベント

AccountCommandsRequested

ユーザーが [アカウント] ウィンドウを開いたときに発生します。 このイベントを処理すると、アプリはアカウント コマンドを初期化し、ユーザーがウィンドウを閉じるまで UI を一時停止できます。

適用対象

こちらもご覧ください