How to control the order of module initialization in Prism

后端 未结 7 832
暖寄归人
暖寄归人 2020-12-28 21:34

I\'m using Prism V2 with a DirectoryModuleCatalog and I need the modules to be initialized in a certain order. The desired order is specified with an attribute on each IModu

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-28 22:00

    You can use the ModuleDependency attribute on your module class to tell the loader that your module depends on other modules:

    [ModuleDependency("SomeModule")]
    [ModuleDependency("SomeOtherModule")]
    public class MyModule : IModule
    {
    }
    

提交回复
热议问题