Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ModuleInfo collection to IModuleManager #2180

Merged
merged 2 commits into from
Aug 24, 2020
Merged

Conversation

dansiegel
Copy link
Member

@dansiegel dansiegel commented Aug 24, 2020

Description of Change

Prism previously introduced a number of great extensions off of the IModuleCatalog to check if a Module exists, or is initialized, however in order to validate the current state of a module you must inject both the IModuleManager and IModuleCatalog.

In this scenario it is extremely unlikely that you care at all about the IModuleCatalog and that you only want to be able to load an uninitialized Module. These changes simplify the dependencies you need to handle this simple task.

Linked Issues

API Changes

Added:

  • IEnumerable IModuleManager.Modules { get; }

IModuleManager Extensions

  • bool ModuleExists<T>()
  • bool ModuleExists(string name)
  • ModuleState GetModuleState<T>()
  • ModuleState GetModuleState(string name)
  • bool IsModuleInitialized<T>()
  • bool IsModuleInitialized(string name)
  • void LoadModule<T>()

IModuleCatalog Extensions

  • ModuleState GetModuleState<T>()
  • ModuleState GetModuleState(string name)

Behavioral Changes

none

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard

Copy link
Member

@brianlagunas brianlagunas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tests would be nice 😄

@dansiegel dansiegel merged commit 6daceb0 into master Aug 24, 2020
@dansiegel dansiegel deleted the module-manager branch August 24, 2020 22:37
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] Add Module list as property of IModuleManager
2 participants