Skip to content

Instantly share code, notes, and snippets.

@dbuksbaum
Created August 19, 2011 15:58
Show Gist options
  • Save dbuksbaum/1157170 to your computer and use it in GitHub Desktop.
Save dbuksbaum/1157170 to your computer and use it in GitHub Desktop.
Caliburn.Micro Event Aggregator Extensions
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