다음을 통해 공유


UserActivityChannel.TryGetForWebAccount(WebAccount) 메서드

정의

사용자 활동을 기록하는 데 사용할 지정된 웹 계정과 관련된 채널을 가져옵니다.

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

매개 변수

account
WebAccount

사용자 활동을 연결할 웹 계정입니다.

반환

사용자 활동을 기록하는 데 사용할 채널입니다. 채널은 웹 계정과 연결됩니다.

Windows 요구 사항

디바이스 패밀리
Windows 10, version 1803 (10.0.17134.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v6.0에서 도입되었습니다.)

예제

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

설명

메일과 같은 일부 앱은 앱의 단일 instance 내에서 여러 사용자 계정을 지원합니다. 사용자에게 MSA(Microsoft 계정) 및 AAD(Azure Active Directory 계정)가 있는 경우 앱은 MSA 계정 또는 AAD 계정과 연결된 활동 피드에 쓰도록 선택할 수 있습니다.

적용 대상