diff --git a/src/Prism.Core/Modularity/IModule.cs b/src/Prism.Core/Modularity/IModule.cs index d0a3973dd8..72677fc1c6 100644 --- a/src/Prism.Core/Modularity/IModule.cs +++ b/src/Prism.Core/Modularity/IModule.cs @@ -5,16 +5,37 @@ namespace Prism.Modularity /// /// Defines the contract for the modules deployed in the application. /// + /// + /// + /// is the base interface for modular components in Prism applications. + /// Modules are self-contained units that encapsulate specific features or domain logic and can be + /// developed, tested, and deployed independently. + /// + /// + /// Each module must implement the registration of its types during the initialization phase + /// and can perform additional setup in the OnInitialized method. + /// + /// public interface IModule { /// /// Used to register types with the container that will be used by your application. /// + /// The container registry where types can be registered. + /// + /// This method is called during the module initialization phase, before OnInitialized. + /// Use this to register all services, views, and other components provided by this module. + /// void RegisterTypes(IContainerRegistry containerRegistry); /// /// Notifies the module that it has been initialized. /// + /// The container provider that can be used to resolve services. + /// + /// This method is called after all modules have registered their types. + /// Use this to initialize the module's functionality, register views with regions, or set up event subscriptions. + /// void OnInitialized(IContainerProvider containerProvider); } } diff --git a/src/Prism.Core/Modularity/IModuleManager.cs b/src/Prism.Core/Modularity/IModuleManager.cs index 4a1b3d65fb..45f3742083 100644 --- a/src/Prism.Core/Modularity/IModuleManager.cs +++ b/src/Prism.Core/Modularity/IModuleManager.cs @@ -6,32 +6,67 @@ namespace Prism.Modularity /// /// Defines the interface for the service that will retrieve and initialize the application's modules. /// + /// + /// + /// orchestrates the loading and initialization of all modules in the application. + /// It works with the to determine which modules to load and when to load them, + /// based on their . + /// + /// + /// The module manager handles the complete lifecycle of modules from discovery through initialization, + /// including error handling and reporting progress during module loading. + /// + /// public interface IModuleManager { /// /// Gets all the classes that are in the . /// + /// An enumerable collection of all registered modules. + /// + /// This provides a read-only view of all modules that have been registered with the module catalog. + /// IEnumerable Modules { get; } /// /// Initializes the modules marked as on the . /// + /// + /// + /// This method starts the module loading process. Only modules marked with + /// will be loaded. Modules with must be explicitly loaded using . + /// + /// + /// Events will be raised as modules load or fail to load. + /// + /// void Run(); /// /// Loads and initializes the module on the with the name . /// /// Name of the module requested for initialization. + /// + /// This method can be used to load modules on-demand at runtime. The module will be loaded regardless of its + /// setting. + /// void LoadModule(string moduleName); /// /// Raised repeatedly to provide progress as modules are downloaded. /// + /// + /// This event is raised during module loading to report progress. It can be used to show loading progress in the UI. + /// event EventHandler ModuleDownloadProgressChanged; /// /// Raised when a module is loaded or fails to load. /// + /// + /// This event is raised for each module when its loading completes, either successfully or with an error. + /// Check the property to determine if the module loaded successfully. + /// event EventHandler LoadModuleCompleted; } }