Open wdcossey opened 9 months ago
Can hack my way around it but would prefer not to use reflection.
typeof(IEventAggregator).GetMethod(nameof(IEventAggregator.RegisterSubscriber))?
.MakeGenericMethod(GetType())
.Invoke(_eventAggregator, new object[] { this });
Hi @wdcossey, sorry for the late reply. I will take a look at this to understand what's going on. And no, it was not intentional that this does not work by default.
I'll come back to you.
Hi,
Firstly thanks for the great package, it has been helping me get rid of so much boilerplate code!
I have an issue when trying to register a subscriber within an abstract class.
FYI: This is not using the
[ViewModelAttribute]
, I just need subscribe to some events.The issue is with the
RegisterSubscriber
methodSpecifically
typeof(TSubscriber).GetInterfaces()
as it will get the base type (i.e. the abstract class), replacing this withsubscriber.GetType().GetInterfaces()
would solve the issue.Not sure if this was intentional or just an oversight but I am happy to correct it and open a PR [if it is a bug].
Thanks, Will.