C
Join ServerC#
help
❔ basic c# how to inherits toolkit ObservableRecipient when you are already inherit something else ?
TTotechsStrypper2/8/2023

AAntonC2/8/2023
you can't inherit from two things
TTotechsStrypper2/8/2023
yeah ...
AAntonC2/8/2023
that's it, you just won't be able to
AAntonC2/8/2023
look for a different solution
TTotechsStrypper2/8/2023
I don't think the toolkit invent this only to use inside VM
AAntonC2/8/2023
use composition if possible
TTotechsStrypper2/8/2023
we have multple properties everywhere in code behind
KKlarth2/8/2023
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.KKlarth2/8/2023

KKlarth2/8/2023
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.KKlarth2/8/2023
Well, maybe not a "lot", but certainly measurable.
TTotechsStrypper2/8/2023
I added those 2 tags but still unable to le me use the class

KKlarth2/8/2023
Yeah, if the base type has another INPC implementation, then you're out of luck, AFAIK.
KKlarth2/8/2023
If you're only using the messenger, then you can still grab a reference via
WeakReferenceMessenger
in the ctor and register handlers.TTotechsStrypper2/8/2023
yeah Im currently not looking for that now
AAccord2/9/2023
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.