Launching

An app starts out in the not running state. It can transition to running in one of two ways:

Launching—The user clicks its primary tile, a secondary tile (if the app has any), or performs an equivalent action, such as clicking the app name from the list of installed apps. These conditions cause Application.OnLaunched to be called.

Activating—The user invokes the app as the target of a contract (if it supports any), such as an entry point in the Share pane. This causes an Application.OnXXXActivated method to be called instead.

As seen in Chapter 1, “Hello, Real World!” the Visual Studio-generated App.xaml.cs overrides OnLaunched in order to initialize the app’s content and navigate to the main Page. Nothing is done for the “activating” ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.