IApplicationService Interface
Collapse the table of content
Expand the table of content

IApplicationService Interface

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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)

public interface IApplicationService

The IApplicationService type exposes the following members.

Public methodStartServiceCalled by an application in order to initialize the application extension service.
Public methodStopServiceCalled by an application in order to stop the application extension service.

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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2016 Microsoft