question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EventAggregator calling handler multiple times with inherited object

See original GitHub issue

Consider the following objects:

public class MyEventObject
{
 public int PropertyOne { get; set; }
}
public class MyGenericEventObject<TValue> : MyEventObject
{
 public TValue SomeValue { get; set; }
}

With the v4.0-Alpha1 version of CM, I’m getting two calls to an IHandle<MyEventObject> whereas in the v3.x version of CM, I’m only getting a single call. Is this by design or a bug in the system?

Will review further and see if maybe there is a bug on my side, as this is a new discovery and I did not have this in prior usage of the v4.0-alpha1 libs.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nigel-sampsoncommented, Jul 23, 2018

What you’ve got there looks fine, if I can’t recreate the issue later on I’ll come back to you.

0reactions
dealproccommented, Jul 10, 2019

Let’s close it for now… if/when i get back to the solution, i will test and re-check this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - EventAggregator multiple fired on one event
and then move several times between different pages, then when this event is called, it fires on the MainPageViewModel several times.
Read more >
The Event Aggregator
When a subscriber is passed to the EventAggregator it is broken down into a special object called a Handler and a weak reference...
Read more >
How To Use Prism EventAggregator for .NET App ...
First, we need to call GetEvent<TEvent>() on our EventAggregator, which will return an instance of our event. Then we call Subscribe(…) on the ......
Read more >
WPF » 09 Communication - PrismNew - Read the Docs
This topic provides guidance when to use delegate commands and routed commands and when to use event aggregator and .NET framework events. When...
Read more >
Event Aggregator
It gathers events from multiple sources and propagate them to interested parties. The event aggregator is loosely coupled with both ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found