multiple inheritance workaround?
-
hi, i have to inherit from multiple classes. a base class i wrote, and a wpf class, like Image or so, because i'm writing some custom controls. i know c# doesn't have multiple inheritance. how can i achieve multiple inheritance functionality? thanks, donovan
rather have something you don't need, than need something you don't have
-
hi, i have to inherit from multiple classes. a base class i wrote, and a wpf class, like Image or so, because i'm writing some custom controls. i know c# doesn't have multiple inheritance. how can i achieve multiple inheritance functionality? thanks, donovan
rather have something you don't need, than need something you don't have
Check out this article: http://www.c-sharpcorner.com/UploadFile/cbreakspear/MultipleInheritance11082005004843AM/MultipleInheritance.aspx[^]
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
hi, i have to inherit from multiple classes. a base class i wrote, and a wpf class, like Image or so, because i'm writing some custom controls. i know c# doesn't have multiple inheritance. how can i achieve multiple inheritance functionality? thanks, donovan
rather have something you don't need, than need something you don't have
Use Interfaces http://www.google.com/search?hl=en&q=c%23+multiple+inhertitence[^]
-
Check out this article: http://www.c-sharpcorner.com/UploadFile/cbreakspear/MultipleInheritance11082005004843AM/MultipleInheritance.aspx[^]
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
thanks,but how can i use the code that adds my custom event handlers in my class when i convert it to an interface?
rather have something you don't need, than need something you don't have
-
hi, i have to inherit from multiple classes. a base class i wrote, and a wpf class, like Image or so, because i'm writing some custom controls. i know c# doesn't have multiple inheritance. how can i achieve multiple inheritance functionality? thanks, donovan
rather have something you don't need, than need something you don't have
The official way of simulating multiple inheritance is to combine single inheritance with composition.
Kevin
-
hi, i have to inherit from multiple classes. a base class i wrote, and a wpf class, like Image or so, because i'm writing some custom controls. i know c# doesn't have multiple inheritance. how can i achieve multiple inheritance functionality? thanks, donovan
rather have something you don't need, than need something you don't have
In C#, multiple inheritance is not an option, you may only inherit from one base class. If you are not satisfied with the "interface" approach, then you might consider extending one class and creating a member of the new class of the type implemented by your second class. That way, you'll be able to benefit from the methods of the second class.
SkyWalker