Class AppBuilder
A builder to create an App instance with required services.
Implements
Inherited Members
Namespace: Unity.AppUI.MVVM
Assembly: Unity.AppUI.MVVM.dll
Syntax
public class AppBuilder : IAppBuilder
Properties
services
The available services of the application.
Declaration
public IServiceCollection services { get; }
Property Value
| Type | Description |
|---|---|
| IServiceCollection |
Remarks
The services can be registered in the builder before building the service provider. After building the service provider, the services become read-only.
Methods
BuildWith<THost>(THost)
Build and initialize the app with the given host.
Declaration
public IApp<THost> BuildWith<THost>(THost host) where THost : class, IHost
Parameters
| Type | Name | Description |
|---|---|---|
| THost | host | The host to use. |
Returns
| Type | Description |
|---|---|
| IApp<THost> | The built app instance. |
Type Parameters
| Name | Description |
|---|---|
| THost | The type of the host to use. |
InstantiateWith<TApp, THost>()
Instantiates a new AppBuilder with the default services according to the given App type.
Declaration
public static AppBuilder InstantiateWith<TApp, THost>() where TApp : class, IApp<THost> where THost : class, IHost
Returns
| Type | Description |
|---|---|
| AppBuilder | The instantiated AppBuilder. |
Type Parameters
| Name | Description |
|---|---|
| TApp | The type of the app to build. It is expected that this type is a subclass of App. |
| THost | The type of the host to use. |