Sdílet prostřednictvím


Application.ApplicationLifetimeObjects Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets the application extension services that have been registered for this application.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public ReadOnly Property ApplicationLifetimeObjects As IList
public IList ApplicationLifetimeObjects { get; }
<Application>
  <Application.ApplicationLifetimeObjects>
    oneOrMoreServiceElements
  </Application.ApplicationLifetimeObjects>
</Application>

XAML Values

  • oneOrMoreServiceElements
    One or more object elements, each of which creates and defines an IApplicationService instance. Each element requires an XML namespace prefix mapped to the namespace and assembly where the service is defined.

Property Value

Type: System.Collections.IList
The registered services.

Remarks

Application extension services let you extend the Silverlight application model without requiring specialized Application subclasses. Applications can continue to inherit the Application class directly, and can add extensions by populating the ApplicationLifetimeObjects list. Applications can do this in the class constructor or in the application XAML.

Application extension services implement the IApplicationService interface and optionally the IApplicationLifetimeAware interface. These interfaces define access points to the application lifetime events.

The order of the services in the ApplicationLifetimeObjects list dictates the order in which the services are initialized. This is also the order in which the services receive application lifetime event notifications. The services are shut down in the opposite order. The guaranteed ordering enables services to fulfill complex dependencies in the application and in other services.

For more information, see Application Extension Services.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.