LaunchActivatedEventArgs Class

Definition

Provides event information when an app is launched.

JavaScript This type appears as WebUILaunchActivatedEventArgs.

public ref class LaunchActivatedEventArgs sealed : IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
public ref class LaunchActivatedEventArgs sealed : IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs2, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class LaunchActivatedEventArgs final : IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class LaunchActivatedEventArgs final : IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs2, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class LaunchActivatedEventArgs : IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class LaunchActivatedEventArgs : IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs2, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
Public NotInheritable Class LaunchActivatedEventArgs
Implements IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
Public NotInheritable Class LaunchActivatedEventArgs
Implements IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs2, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
Inheritance
Object Platform::Object IInspectable LaunchActivatedEventArgs
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

This object is accessed when you respond to Activated events when ActivationKind is Launch.

UWP app using C++, C#, or Visual Basic typically implement activation points by overriding methods of the Application object. The default template app.xaml code-behind files always include an override for OnLaunched. The default implementation includes initial navigation support and state management through the SuspensionManager helper class.

All Application overrides involved in an activation scenario should call Window.Activate in their implementations.

Avoid performing tasks during launch if they could significantly increase the time required to launch your app. Instead, you can trigger additional loading tasks by listening for the SplashScreen.Dismissed event.

The activation deferral object should not be used to complete complex tasks during activation. Any unhandled errors or exceptions that occur during activation (including deferred activation) will cause the app to crash. If you need to perform network calls or process a number of additional files during activation, consider launching your app to an extended splash screen and then performing these operations. For more information, see How to display a splash screen for an extended time.

Important

Apps that require an excessive amount of time to launch may be terminated by the system.

When testing your app, be aware that immediately reactivating an app that has just been terminated will result in a failed activation if the splash screen is still visible.

JavaScript launch completion

If programming with JavaScript, launch is complete when your activated event handler returns successfully after executing your launch tasks.

.NET launch completion

If programming with C#, VB, or C++, launch is complete when you activate an app window.

Version history

Windows version SDK version Value added
1607 14393 TileActivatedInfo
1607 14393 User

Properties

Arguments

Gets the arguments that are passed to the app during its launch activation.

CurrentlyShownApplicationViewId

Gets the identifier for the currently shown app view.

Kind

Gets the reason that this app is being activated.

PrelaunchActivated

Indicates whether the app was pre-launched.

PreviousExecutionState

Gets the execution state of the app before this activation.

SplashScreen

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

TileActivatedInfo

Gets additional information that is provided when the user launches your app from a tile. This will be null if the app is not launched from its tile or if the app is launched on a platform that doesn't support this property.

TileId

Gets the ID of the tile that was invoked to launch the app.

User

Gets the user that the app was activated for.

ViewSwitcher

Gets the view switcher object that allows you to set the view for the application.

Applies to

See also