@@ -379,8 +379,8 @@ aggregator.TryRegisterObservable(
379
379
new [] {nameof (INotifyPropertyChanged .PropertyChanged )});
380
380
```
381
381
382
- ##### Listen to all aggregated event sources by event name
383
- Subscribe to the ` EventAggregator ` and listen to specific events of all aggregated event sources:
382
+ ##### Listen to * all* aggregated event sources * by event name*
383
+ Subscribe to the ` EventAggregator ` and listen to specific events of ** all** aggregated event sources:
384
384
385
385
``` C#
386
386
// Listen to everything that publishes the 'INotifyPropertyChanged.PropertyChanged' event
@@ -389,8 +389,8 @@ aggregator.TryRegisterObserver<PropertyChangedEventHandler>(
389
389
ShowMessage_OnPropertyChanged );
390
390
```
391
391
392
- ##### Listen to specific aggregated event sources by event name
393
- Subscribe to the ` EventAggregator ` and listen to specific events of specific aggregated event sources:
392
+ ##### Listen to * specific* aggregated event sources by event name
393
+ Subscribe to the ` EventAggregator ` and listen to specific events of ** specific** aggregated event sources (by source type) :
394
394
395
395
``` C#
396
396
// Only listen to the 'INotifyPropertyChanged.PropertyChanged' event raised by any instance of type 'MainWindowViewModel'
@@ -406,13 +406,17 @@ aggregator.TryRegisterObserver<PropertyChangedEventHandler>(
406
406
ShowMessage_OnPropertyChanged );
407
407
```
408
408
##### Listen to all events that match the signature of the event handler or that use a matching ` EventArgs ` type
409
- Subscribe to the ` EventAggregator ` and listen to specific events of specific aggregated event sources:
410
409
410
+ Subscribe to the ` EventAggregator ` and listen to all events that have an event delegate with matching signature:
411
411
``` C#
412
412
413
413
// Subscribe by defining the event delegate explicitly
414
414
aggregator .TryRegisterGlobalObserver (new PropertyChangedEventHandler (ShowMessage_OnPropertyChanged ));
415
+ ```
416
+
417
+ Subscribe to the ` EventAggregator ` and listen to all events that use a matching ` EventArgs ` type:
415
418
419
+ ``` C#
416
420
// Subscribe by defining the EventArgs as generic type parameter
417
421
aggregator .TryRegisterGlobalObserver <PropertyChangedEventArgs >(ShowMessage_OnPropertyChanged );
418
422
```
0 commit comments