UserActivityChannel.TryGetForWebAccount(WebAccount) Metodo

Definizione

Ottenere un canale, specifico di un account Web specificato, da usare per registrare l'attività dell'utente.

public:
 static UserActivityChannel ^ TryGetForWebAccount(WebAccount ^ account);
 static UserActivityChannel TryGetForWebAccount(WebAccount const& account);
public static UserActivityChannel TryGetForWebAccount(WebAccount account);
function tryGetForWebAccount(account)
Public Shared Function TryGetForWebAccount (account As WebAccount) As UserActivityChannel

Parametri

account
WebAccount

Account Web a cui associare l'attività dell'utente.

Restituisce

Canale da usare per registrare l'attività dell'utente. Il canale verrà associato all'account Web.

Requisiti Windows

Famiglia di dispositivi
Windows 10, version 1803 (è stato introdotto in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (è stato introdotto in v6.0)

Esempio

private static UserActivityChannel _currentChannel;

public static void UpdateActivityChannelForAccount(WebAccount account)
{
    _currentChannel = UserActivityChannel.TryGetForWebAccount(account);
    if (_currentChannel != null)
    {
        // app-specific – generate activity that will be associated with the web account
    }
}

Commenti

Alcune app, ad esempio Mail, supportano più account utente all'interno di una singola istanza dell'app. Se l'utente ha un account Microsoft (MSA) e un account Azure Active Directory (AAD), l'app può scegliere di scrivere nel feed attività associato all'account DEL servizio gestito o all'account AAD.

Si applica a