event handlers are great if you have a view that references another view and listens for its events, which is ideal for decoupling and reuse.
the problem, although sometimes I have views that are not referenced, so I use the Event Aggregator, which is a global notification, to find out if something happened ... but it seems wrong when I just wanted to listen to children's views that I cannot reference, something like bubbling events in a DOM hierarchy.
but let me say that I have a view hierarchy, for example:
I wanted to know in ParentView when ModalView fires an event ... I cannot use the bubbling event because ModalView is not in the same DOM hierarchy, so should I use Event Agregator in this case or something else? I really wanted the event bubble to fit in my case.
source
share