Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This requires Caliburn.Micro!
- static class AggregatorProvider
- {
- public static EventAggregator Aggregator = new EventAggregator();
- }
- //Now, in each class
- public class SomeClass : IHandle<object>
- //Main constructor for class add:
- AggregatorProvider.Aggregator.Subscribe(this);
- //then add this function:
- public void Handle(object message) {
- //Do something with the object
- }
- //Then to send
- AggregatorProvider.Aggregator.Publish(someObject);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement