Eventaggregator handler being fired twice.

Topics: Bugs
Jun 18, 2013 at 1:45 PM
Edited Jun 18, 2013 at 1:46 PM
Hi Everyone.

I'm having an odd issue.

I'm developing an app in WPF MVVM and I'm using the EventAggregator to communicate between unrelated viewmodels.

I have an AddressAdded.cs class which contains an AddressAdd property (bool).

In my child viewmodel I'm publishing like this:
var added = new AddressAdded() { AddressAdd = true };
_eventAggregator.Publish(added);
In my parent viewmodel I'm handling it as follows:
public void Handle(AddressAdded added)
{
    GetAddresses();
 }
The issue is that the Handle event is firing twice.

Can anyone perhaps point me in the right direction??

Thanks!!
Devon Britton.
Jun 18, 2013 at 2:03 PM
Edited Jun 18, 2013 at 2:03 PM
Fixed.

I had multiple instances of the eventaggregator.