LaunchActivatedEventArgs
LaunchActivatedEventArgs
LaunchActivatedEventArgs
LaunchActivatedEventArgs
LaunchActivatedEventArgs
Class
Definition
Provides event information when an app is launched.
JavaScript This type appears as WebUILaunchActivatedEventArgs.
public : sealed class LaunchActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs, ILaunchActivatedEventArgs2, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
struct winrt::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs, ILaunchActivatedEventArgs2, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
public sealed class LaunchActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs, ILaunchActivatedEventArgs2, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
Public NotInheritable Class LaunchActivatedEventArgs Implements IActivatedEventArgs, IActivatedEventArgsWithUser, IApplicationViewActivatedEventArgs, ILaunchActivatedEventArgs, ILaunchActivatedEventArgs2, IPrelaunchActivatedEventArgs, IViewSwitcherProvider
// This class does not provide a public constructor.
- Attributes
Windows 10 requirements
Device family |
Windows 10 (introduced v10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
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 Arguments Arguments Arguments Arguments |
Gets the arguments that are passed to the app during its launch activation. |
CurrentlyShownApplicationViewId CurrentlyShownApplicationViewId CurrentlyShownApplicationViewId CurrentlyShownApplicationViewId CurrentlyShownApplicationViewId |
Gets the identifier for the currently shown app view. |
Kind Kind Kind Kind Kind |
Gets the reason that this app is being activated. |
PrelaunchActivated PrelaunchActivated PrelaunchActivated PrelaunchActivated PrelaunchActivated |
Indicates whether the app was pre-launched. |
PreviousExecutionState PreviousExecutionState PreviousExecutionState PreviousExecutionState PreviousExecutionState |
Gets the execution state of the app before this activation. |
SplashScreen SplashScreen SplashScreen SplashScreen SplashScreen |
Gets the splash screen object that provides information about the transition from the splash screen to the activated app. |
TileActivatedInfo TileActivatedInfo TileActivatedInfo TileActivatedInfo 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 TileId TileId TileId TileId |
Gets the ID of the tile that was invoked to launch the app. |
User User User User User |
Gets the user that the app was activated for. |
ViewSwitcher ViewSwitcher ViewSwitcher ViewSwitcher ViewSwitcher |
Gets the view switcher object that allows you to set the view for the application. |
See also
Feedback
Loading feedback...