Table of Contents

Class ModuleManager

Namespace
Crystal.Avalonia
Assembly
Crystal.Avalonia.dll

Manages and initializes application modules. Automatically created and used by the framework during OnFrameworkInitializationCompleted().

public class ModuleManager : IModuleRegistrar
Inheritance
ModuleManager
Implements
Inherited Members

Properties

LoadModules

Gets the list of registered modules.

public IList<IModule> LoadModules { get; set; }

Property Value

IList<IModule>

Methods

InitModules(IServiceProvider)

Iterates through all registered modules and calls their InitializeModule(IServiceProvider) method to perform module initialization. Automatically invoked by the framework after the service provider is built.

public void InitModules(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

The service provider.

InitService(IServiceCollection)

Iterates through all registered modules and calls their RegisterServices(IServiceCollection) method to register services into the container. Automatically invoked by the framework before the service provider is built.

public void InitService(IServiceCollection services)

Parameters

services IServiceCollection

The service collection.

RegisterModule(IModule)

Registers an already instantiated module.

public void RegisterModule(IModule module)

Parameters

module IModule

The module instance to register.

RegisterModule<TModule>()

Registers a module type. The system will automatically instantiate the module.

public void RegisterModule<TModule>() where TModule : IModule

Type Parameters

TModule

The module type, must implement IModule and have a public parameterless constructor.