WebUIApplication.Activated Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the app is activated.
public:
static event ActivatedEventHandler ^ Activated;
// Register
static event_token Activated(ActivatedEventHandler const& handler) const;
// Revoke with event_token
static void Activated(event_token const* cookie) const;
// Revoke with event_revoker
static WebUIApplication::Activated_revoker Activated(auto_revoke_t, ActivatedEventHandler const& handler) const;
public static event ActivatedEventHandler Activated;
function onActivated(eventArgs) { /* Your code */ }
Windows.UI.WebUI.WebUIApplication.addEventListener("activated", onActivated);
Windows.UI.WebUI.WebUIApplication.removeEventListener("activated", onActivated);
- or -
Windows.UI.WebUI.WebUIApplication.onactivated = onActivated;
Public Shared Custom Event Activated As ActivatedEventHandler
Event Type
Remarks
Whenever your app is launched, the activated event is raised. This event can also be raised while your app is running if the system needs to pass the app parameters related to a new activation contract. You can use the activated event to restore the previous state of your app and to retrieve the activation parameters related to the contract for which your app is being activated. For a full list of the activation contracts and more details on their parameters see the ActivationKind enumeration. Note that you can also use the WinJS Onactivated event to handle app activation.
Note
: If your app needs to navigate the top level document for any reason you must first complete activation before attempting to do the top level navigation. If you attempt a top level navigation before activation completes your app will crash. This ensures that your app and the system are in a consistent state before the JavaScript context is torn down and recreated during the navigation.