Delen via


UserActivitySession Class

Definition

Tracks a UserActivity while the user is engaged in that activity.

public ref class UserActivitySession sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 327680)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class UserActivitySession final : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 327680)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class UserActivitySession : System.IDisposable
Public NotInheritable Class UserActivitySession
Implements IDisposable
Inheritance
Object Platform::Object IInspectable UserActivitySession
Attributes
Implements

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Remarks

A UserActivity is associated with an UserActivitySession which tracks how long the user is engaged in that activity. For example, an activity such as watching a movie can occur a little at a time over the course of multiple days. When the user first starts the new activity of watching a movie, a UserActivitySession must be created. It should be disposed when the user switches to different activity. When the user resumes watching the movie, create another UserActivitySession from the original UserActivity to track the activity as long as the user is watching the movie.

Properties

ActivityId

Gets the id of this UserActivitySession.

Methods

Close()

Indicates that the user is no longer engaged in the activities associated with this session.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Applies to