C#/Prism

[Prism] Call Moule Class

딸기우유중독 2023. 2. 1. 11:53

Test 필요.


 

how to call wpf prism module class

You can call a WPF Prism module class by using the IModuleManager service provided by Prism. 
You can use the IModuleManager to load a module by type or name and then call the module's class methods. 
Here is an example of how you can use IModuleManager to load a module and call its class methods:

// Get the IModuleManager service from the service locator 
IModuleManager moduleManager = ServiceLocator.Current.GetInstance<IModuleManager>(); 
// Load the module by type 
moduleManager.LoadModule(typeof(MyModule)); 
// Get the module instance 
MyModule module = ServiceLocator.Current.GetInstance<MyModule>(); 
// Call a method on the module instance 
module.MyMethod();

 

728x90