Advertisement
parabola949

Untitled

Jun 10th, 2014
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. //This requires Caliburn.Micro!
  2.  
  3. static class AggregatorProvider
  4.     {
  5.         public static EventAggregator Aggregator = new EventAggregator();
  6.     }
  7.  
  8. //Now, in each class
  9. public class SomeClass : IHandle<object>
  10. //Main constructor for class add:
  11. AggregatorProvider.Aggregator.Subscribe(this);
  12.  
  13. //then add this function:
  14. public void Handle(object message) {
  15.     //Do something with the object            
  16.         }
  17.  
  18. //Then to send
  19. AggregatorProvider.Aggregator.Publish(someObject);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement