When you create an application using the managed API for Silverlight, you must create a class that derives from Application. The Application class provides several services that applications commonly require. Primarily, it represents the entry point of your application code in the Silverlight plug-in life cycle.
The Silverlight plug-in life cycle begins when a user navigates to a Web page that hosts the Silverlight plug-in. If the user has installed Silverlight, the Web browser activates the plug-in and begins downloading your application package.
The plug-in loads the Silverlight core services followed by the Silverlight common language runtime (CLR), which creates an AppDomain for your application. When your application package download is complete, the CLR instantiates your Application class and raises its Startup event.
You can add code to your application class constructor. However, you typically use a Startup event handler for most application initialization tasks, such as displaying a user interface page.
The following diagram illustrates the plug-in activation process and the relationship between components in the process.
.png)
For more information about the Silverlight core services and CLR, see Silverlight Architecture. For more information about the Silverlight application package, see Application Structure.
There can be only one Application instance in a Silverlight-based application. After startup, the Application instance provides several services that applications commonly require. You can access these services from any code in your application by retrieving the Application instance from the static Application..::.Current property.
This topic describes the following features of the Application class.
Application lifetime management.
Application resource file loading.
Unhandled exception processing.
Web host integration.
Extensibility.