Partager via


IApplicationService Interface

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

Defines methods that application extension services must implement in order to enable an application to start and stop the service.

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

Syntax

'Declaration
Public Interface IApplicationService
public interface IApplicationService

The IApplicationService type exposes the following members.

Methods

  Name Description
Public methodSupported by Silverlight for Windows Phone StartService Called by an application in order to initialize the application extension service.
Public methodSupported by Silverlight for Windows Phone StopService Called by an application in order to stop the application extension service.

Top

Remarks

You can add extension services to an application using XAML or procedural code with the Application.ApplicationLifetimeObjects property.

Application extension services must implement the IApplicationService interface in order to perform start and stop operations. Before the Application.Startup event, the application calls the StartService method for each service in the order in which they were registered. After the Application.Exit event, the application calls the StopService method for each service in the reverse order. This start and stop ordering enables services to create dependencies on other services.

Application extension services can optionally implement the IApplicationLifetimeAware interface in order to perform operations immediately before and after the Application.Startup and Application.Exit events.

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.