I have Prism Shell application, There is class which primarily focused execuing method on subscribed events. These events are fired from a separate module in my solution.
My class is ApplicationMenuSubscriber which is in my shell application. My shell is boot strapped with MEFBootStrapper. I may not directly want to wire my ApplicationMenuSubscriber inside shell startup, instead i want this class to be picked up automatically by MEF. Is there a way in doing this in Prism
public class ApplicationMenuSubscriber
{
private readonly IRegionManager regionManager;
private readonly IMenuService menuService;
private readonly IEventAggregator events;
[ImportingConstructor]
public ApplicationMenuSubscriber(IRegionManager regionManager, IEventAggregator events, IMenuService menuService)
{
this.regionManager = regionManager;
this.menuService = menuService;
this.events = events;
//subscribe to events
events.GetEvent<MenuEvent>().Subscribe(MenuFired);
}
private void MenuFired(ApplicationEventArgs obj)
{
//check
if (obj.Source == MenuConstants.LOGIN)
{
//log
}
}
}