Sometimes the Prism Application may need the hierarchical event aggregator. In this post, I want to share my implementation of HierarchicEventAggregator.
IHierarchicEventAggregator.cs
HierarchicEventAggregator.cs
1. To create the instances, do the following:
IHierarchicEventAggregator root = new HierarchicEventAggregator();
IHierarchicEventAggregator workspace1 = root.CreateChildHierarchicEventAggregator();
IHierarchicEventAggregator workspace2 = root.CreateChildHierarchicEventAggregator();
2. To publish the event locally, do the following:
workspace2.PublishToLocalSubscribers<TabClosedEvent, TabClosedEventArgs>(new TabClosedEventArgs() { });
3. To publish the event for each hierarchic level, do the following:
workspace1.PublishToAllSubscribers<TabClosedEvent, TabClosedEventArgs>(new TabClosedEventArgs() { });
I hope this has been useful to you!
Looking for quality Silverlight Hosting? Look no further than Arvixe Web Hosting!