EventAggregator and PubSubEvent. Questions. #3128
Unanswered
romaromaniv
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all.
Let's assume that we have 2 constructors
public SomeClassA(IEventAggregator eventAggregator)
{
}
and
public SomeClassB(SomePubSubEvent event)
{
_event = event;
}
How will be created event for the second constructor?
Will I have the same instance of event if the second constructor will be changed to
public SomeClassB(IEventAggregator eventAggregator)
{
_event = eventAggregator.GetEvent< SomePubSubEvent >();
}
?
Finally - all references from different modules to event of certain type should be references to the same instance of event?
Also - If I have different modules, which uses separate MyEvents.dll, but in first case I publish event A from MyEvents.dll version 1.0.0,
but in another module I do subscription to event A from MyEvents.dll 1.1.0 - should the subscription work?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions