In our project we use the Composite WPF model, and we needed a way to publish events from our views (XAML code) without creating any code-behind, and without having any dependencies. To publish and subscribe to events, we already used
IEventAggregator, but still we had to write some code-behind in order to publish the events.
So we came up with what we call "
About the Example
In this example, I'm going to implement
SelectedItemsChanged on a
datagrid resides in a view, and I wish to subscribe to this event in some
First we create an
set methods, and a callback to perform some logic. This class resides in our Infrastructure project, and namespace Events.