I have a problem with control inheritance in WPF. I created a UserControl named BaseUserControl. I want this control to be a basic control for other WPF user controllers. So I wrote another UserControl called FirstComponent. In the next step, I changed this code
FirstComponent : UserControl
to that
FirstComponent : BaseControl
However, during compilation I get this error
Partial declarations of 'controlinheritance.componenets.FirstComponent' must not specify different base classes
What do I need to do to get FirstComponent from BaseControl?
EDIT Thanks to the response abhishek, I managed to inherit the controls. I have one more question. In the base class, I specified the property public Grid _MainGrid {get; set; }. Now I want an instance of this mesh to be created in my derived class. So I used this Howerver code. I get an error. The property "_MainGrid" does not matter. Line 8 Position 36.
source
share