UserWatcher UserWatcher UserWatcher UserWatcher Class

Definition

Provides events that fire during enumeration of users, when the collection of users changes, or when a user's authentication status changes.

public : sealed class UserWatcher : IUserWatcherpublic sealed class UserWatcher : IUserWatcherPublic NotInheritable Class UserWatcher Implements IUserWatcher// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

Status Status Status Status

Gets the status of a user watcher.

public : UserWatcherStatus Status { get; }public UserWatcherStatus Status { get; }Public ReadOnly Property Status As UserWatcherStatus// You can use this property in JavaScript.

Methods

Start() Start() Start() Start()

Starts the user watcher.

public : void Start()public void Start()Public Function Start() As void// You can use this method in JavaScript.

Remarks

You must add a handler for the UserWatcher.Added before event before calling Start.

Stop() Stop() Stop() Stop()

Stops the user watcher.

public : void Stop()public void Stop()Public Function Stop() As void// You can use this method in JavaScript.

Events

Added Added Added Added

Fires when a user is added to the collection of users returned by User.FindAllAsync.

public : event TypedEventHandler Added<UserWatcher,  UserChangedEventArgs>public event TypedEventHandler Added<UserWatcher,  UserChangedEventArgs>Public Event Added<UserWatcher,  UserChangedEventArgs>// You can use this event in JavaScript.

AuthenticationStatusChanged AuthenticationStatusChanged AuthenticationStatusChanged AuthenticationStatusChanged

Fires when a user's authentication status has changed.

public : event TypedEventHandler AuthenticationStatusChanged<UserWatcher,  UserChangedEventArgs>public event TypedEventHandler AuthenticationStatusChanged<UserWatcher,  UserChangedEventArgs>Public Event AuthenticationStatusChanged<UserWatcher,  UserChangedEventArgs>// You can use this event in JavaScript.

AuthenticationStatusChanging AuthenticationStatusChanging AuthenticationStatusChanging AuthenticationStatusChanging

Fires when a user's authentication status is about to change.

public : event TypedEventHandler AuthenticationStatusChanging<UserWatcher,  UserAuthenticationStatusChangingEventArgs>public event TypedEventHandler AuthenticationStatusChanging<UserWatcher,  UserAuthenticationStatusChangingEventArgs>Public Event AuthenticationStatusChanging<UserWatcher,  UserAuthenticationStatusChangingEventArgs>// You can use this event in JavaScript.

EnumerationCompleted EnumerationCompleted EnumerationCompleted EnumerationCompleted

Fires when the initial pass of watcher events has been processed and the collection of users is complete.

public : event TypedEventHandler EnumerationCompleted<UserWatcher,  object>public event TypedEventHandler EnumerationCompleted<UserWatcher,  object>Public Event EnumerationCompleted<UserWatcher,  object>// You can use this event in JavaScript.

Removed Removed Removed Removed

Fires when a user is removed from the collection of users returned by User.FindAllAsync.

public : event TypedEventHandler Removed<UserWatcher,  UserChangedEventArgs>public event TypedEventHandler Removed<UserWatcher,  UserChangedEventArgs>Public Event Removed<UserWatcher,  UserChangedEventArgs>// You can use this event in JavaScript.

Stopped Stopped Stopped Stopped

Fires when the user watcher has stopped.

public : event TypedEventHandler Stopped<UserWatcher,  object>public event TypedEventHandler Stopped<UserWatcher,  object>Public Event Stopped<UserWatcher,  object>// You can use this event in JavaScript.

Updated Updated Updated Updated

Fires when the data associated with a user has changed.

public : event TypedEventHandler Updated<UserWatcher,  UserChangedEventArgs>public event TypedEventHandler Updated<UserWatcher,  UserChangedEventArgs>Public Event Updated<UserWatcher,  UserChangedEventArgs>// You can use this event in JavaScript.