StartupTaskActivatedEventArgs StartupTaskActivatedEventArgs StartupTaskActivatedEventArgs StartupTaskActivatedEventArgs Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
Provides information when an app is activated at device startup or user login.

public : sealed class StartupTaskActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgspublic sealed class StartupTaskActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgsPublic NotInheritable Class StartupTaskActivatedEventArgs Implements IActivatedEventArgs, IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Examples

protected override void OnActivated(IActivatedEventArgs args)
{

    string argString = string.Empty;



    // Existing behavior to differentiate different activation kinds,

    // and to extract any argument payload.

    switch (args.Kind)

    {

        case ActivationKind.StartupTask:

            var startupArgs = args as StartupTaskActivatedEventArgs;

            string taskId = startupArgs.TaskId;

            break;

    }

}

Remarks

This functionality is only supported on Windows Desktop.

Properties

Kind Kind Kind Kind

Prerelease. Gets the reason that this app is being activated.

public : ActivationKind Kind { get; }public ActivationKind Kind { get; }Public ReadOnly Property Kind As ActivationKind// You can use this property in JavaScript.
Value
ActivationKind ActivationKind ActivationKind ActivationKind

The expected value is ActivationKind.StartupTask.

PreviousExecutionState PreviousExecutionState PreviousExecutionState PreviousExecutionState

Prerelease. Gets the execution state of the app before it was activated.

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

Remarks

The app uses this information to determine whether it should restore saved state.

SplashScreen SplashScreen SplashScreen SplashScreen

Prerelease. Gets a SplashScreen object that provides information about the transition from the splash screen to the activated app.

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

The object that provides splash screen information.

TaskId TaskId TaskId TaskId

Prerelease. Gets the unique identifier for your task.

public : PlatForm::String TaskId { get; }public string TaskId { get; }Public ReadOnly Property TaskId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

Remarks

The task identifier is specified in the manifest of the app. You can use this identifier to call the APIs in the Windows.ApplicationModel.StartupTask class to programmatically enable or disable a startup task.

User User User User

Prerelease. Gets the user that the app was activated for.

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

The user that the app was activated for.

See Also