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<THostType>(THostType)
Build and initialize the app with the given host.
Declaration
public IApp<THostType> BuildWith<THostType>(THostType host) where THostType : class, IHost
Parameters
Type | Name | Description |
---|---|---|
THostType | host | The host to use. |
Returns
Type | Description |
---|---|
IApp<THostType> | The built app instance. |
Type Parameters
Name | Description |
---|---|
THostType | The type of the host to use. |
InstantiateWith<TAppType, THostType>()
Instantiates a new AppBuilder with the default services according to the given App type.
Declaration
public static AppBuilder InstantiateWith<TAppType, THostType>() where TAppType : class, IApp<THostType> where THostType : class, IHost
Returns
Type | Description |
---|---|
AppBuilder | The instantiated AppBuilder. |
Type Parameters
Name | Description |
---|---|
TAppType | The type of the app to build. It is expected that this type is a subclass of App. |
THostType | The type of the host to use. |