The Application class provides services common to most applications. For more information, see Application Services. You can provide additional services by creating a custom Application subclass, but this could lead to unnecessary complexity. For example, creating a subclass would require that applications derive from your subclass, which prevents the use of multiple extension frameworks at the same time.
Instead of creating a custom Application subclass, you can add application extension services through the Application.ApplicationLifetimeObjects property. This enables you to combine multiple services and implement complex service dependencies.
Application extension services must implement the IApplicationService interface. This interface provides support for service initialization and cleanup. Services can also implement the IApplicationLifetimeAware interface if they require deeper integration with application lifetime events.
This topic contains the following sections:
- Registering Extension Services
- Accessing Extension Services from Application Code
- Implementing the IApplicationService Interface
- Implementing the IApplicationLifetimeAware Interface
Read more: MSDN