Application.OnActivated method

Applies to Windows and Windows Phone

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

Syntax


protected virtual void OnActivated(
  IActivatedEventArgs args
)

Parameters

args

Type: 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 How to activate an app.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml
Windows::UI::Xaml [C++]

Metadata

Windows.winmd

See also

Application
Launching and resuming apps

 

 

Show:
© 2014 Microsoft. All rights reserved.