-
[Prism] Call Moule ClassC#/Prism 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'C# > Prism' 카테고리의 다른 글
[Prism] RegionAdapter (0) 2023.02.01 [Prism] <Control> ContentRegion (0) 2023.02.01 [Prism] CompositeCommand (0) 2023.01.18 [Prism] Dialog (0) 2023.01.06 [Prism] Dynamic loading Modules (0) 2023.01.04 댓글