UI Regions

Plugin UI Basics

A plugin can display its own UI elements at a number of predefined, named locations in Justdecompile UI. These locations are called "regions".

JustDecompile uses Prism regions to implement this functionality. Regions can be accessed by a plugin through the Region Manager (IRegionManager) Prism service.

The Region Manager Service

An instance of the Region Manager service is created by the MEF engine when application is started. Plugins can get a reference to this instance by decorating a local variable of type IRegionManager with the Import attribute.

C#
[Import]
private IRegionManager regionManager;
Note
MEF provides an IPartImportsSatisfiedNotification interface that enables implementers to be notified when a part's imports have been satisfied. It contains a single OnImportsSatisfied() method, which is called when a part's imports have been satisfied and it is safe to use.
C#
[ModuleExport(typeof(PluginModule))]
public class PluginModule : IModule, IPartImportsSatisfiedNotification
{
        public void OnImportsSatisfied()
        {
            this.regionManager.AddToRegion("AssemblyTreeViewContextMenuRegion", assemblyNodeContextMenu);
        }
        ......
}

Regions List

In this article