[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]MVVM Framework
  [Expand]ViewModels
  [Expand]Commands
  [Expand]Behaviors
  [Expand]Services
  [Expand]DXBinding
  [Collapse]MIF
    Getting Started
    Modules
    Regions
    Module Manager
    Saving and Restoring Application State
   Converters
   ViewLocator
   Messenger
   Data Annotation Attributes
   LayoutTreeHelper
   Weak Event
 [Expand]Controls and Libraries
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Module Manager

ModuleManager provides API for integrating modules into an application and configuring navigation.

ModuleManager is available via the ModuleManager.DefaultManager static property.

The ModuleManager provides the following functionality:

Expanded Module Registration

Before displaying a module, it is necessary to register it. You can register or unregister modules using the ModuleManager.Register and ModuleManager.Unregister methods respectively.

Use the ModuleManager.GetModule method to retrieve a module registered in a particular region.

Expanded Injecting and Removing Modules

You can show a registered module in a target region with the ModuleInjection.Inject method.

The ViewModels inside your modules can support the ISupportParameter interface. In this case, you can define the parameter for the ModuleManager.Inject method - it passes to the ISupportParameter.Parameter property of your module's ViewModel. See Passing data between ViewModels (ISupportParameter) for more details.

To remove a module from the UI, use the ModuleInjection.Remove method.

The last parameter controls whether the ViewModelRemoving event is raised (that is, if removing can be canceled).

To get the state of a module, use the ModuleManager.IsInjected method.

To remove all modules from UI, use the ModuleInjection.Clear method. Note that this method does not invoke raising the ViewModelRemoving event, so removing modules cannot be canceled.

Expanded Events

To control modules and navigation, ModuleManager provides a set of events. You can access all the events via the ModuleInjection.GetEvents method.

The code sample below demonstrates the events that are available for a particular region. Note that all events are weak.

To subscribe a particular view model to events provided by ModuleManager use the following.

Expanded Regions

The Module Manager provides the ModuleInjection.GetRegion method to get a Region by its name. To get all the regions from a particular ViewModel, use the ModuleInjection.GetRegions method.

Expanded See Also

Is this topic helpful?​​​​​​​