Application.OnActivated(IActivatedEventArgs) Method

Definition

Invoked when the application is activated by some means other than normal launching.

C#
protected virtual void OnActivated(IActivatedEventArgs args);

Parameters

args
IActivatedEventArgs

Event data for the event.

Remarks

When a user launches your app normally (for example, by tapping the app tile), only the OnLaunched method is called. Override the OnActivated method to perform any general app initialization that should occur only when the app is not launched normally (for example, from another app through the Search contract). You can determine how the app was activated through the IActivatedEventArgs.Kind property.

For most kinds of activation, you can perform initialization specific to the activation type by overriding one of the following methods instead of the OnActivated method:

For more info, see App lifecycle.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also