JustDecompile uses the
Prism event mechanism to notify a plugin about user actions and changes in the UI.This mechanism is based on the Event Aggregator service and allows publishers and subscribers to
communicate through events and still do not have a direct reference to each other.
Event Aggregator Service
An instance of the IEventAggregator is created by the MEF engine when application is started.
Plugin module can get a reference to this instance by applying a local variable with an Import attribute.
private IEventAggregator eventAggregator;
Private eventAggregator As IEventAggregator
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.
public class PluginModule : IModule, IPartImportsSatisfiedNotification
public void OnImportsSatisfied()
Public Class PluginModule
Implements IModule, IPartImportsSatisfiedNotification
Public Sub OnImportsSatisfied()
Me.eventAggregator.GetEvent(Of SelectedTreeViewItemChangedEvent)().Subscribe(New Action(Of ITreeViewItem)(AddressOf OnSelectedTreeViewItemChanged))
JustDecompile defines the following Prism events that can be used as a communication channel between plugin module and JustDecompile application.