Created
August 19, 2011 15:58
-
-
Save dbuksbaum/1157170 to your computer and use it in GitHub Desktop.
Caliburn.Micro Event Aggregator Extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class EventAggregatorExtensions | |
{ | |
public static void Subscribe(this IEventAggregator eventAggregator, params IHandle[] handlers) | |
{ | |
Subscribe(eventAggregator, (IEnumerable<IHandle>)handlers); | |
} | |
public static void Subscribe(this IEventAggregator eventAggregator, IEnumerable<IHandle> handlers) | |
{ | |
foreach(var handler in handlers) | |
{ | |
if(handler != null) | |
eventAggregator.Subscribe(handler); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment