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
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
serviceProviderIServiceProviderThe 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
servicesIServiceCollectionThe service collection.
RegisterModule(IModule)
Registers an already instantiated module.
public void RegisterModule(IModule module)
Parameters
moduleIModuleThe 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
TModuleThe module type, must implement IModule and have a public parameterless constructor.