❔ basic c# how to inherits toolkit ObservableRecipient when you are already inherit something else ?
13 Replies
you can't inherit from two things
yeah ...
that's it, you just won't be able to
look for a different solution
I don't think the toolkit invent this only to use inside VM
use composition if possible
we have multple properties everywhere in code behind
You can get around it with the source gens. If you need to go all the way to
ObservableValidator
, I don't think that's supported but I could be wrong.Keep in mind, that adds the entire implementation of
ObservableObject
and ObservableRecipient
into the VM. So if you do this 100 times, you're going to increase binary size a lot.
Well, maybe not a "lot", but certainly measurable.I added those 2 tags but still unable to le me use the class
Yeah, if the base type has another INPC implementation, then you're out of luck, AFAIK.
If you're only using the messenger, then you can still grab a reference via
WeakReferenceMessenger
in the ctor and register handlers.yeah Im currently not looking for that now
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.