how to have a User Control inherit from another User Control

87 views Asked by At

Recently doing fun personal project in C++/CX UWP.

And I am stuck trying to have a base control class to be used for all my User control. This base class shouldn't have any XAML and just implementing a DispatcherTimer with OnTick func. Let's name it TickControlBase

But when I try to have another UserControl inherit from this one, I get only compiling errors. Let's name it MyUserControl

If TickControlBase inherit from XAML::UserControl, I get an error saying MyUserControl already inherit from XAML::UserControl. If TickControlBase do not inherit from a XAML stuff I have other errors, saying that a ref class have to be sealed or inherit from another ref class. Obvisouly If I sealed it, then no class can inherit from it.

MyUserControl base class def is generated, so I don't have a control on this. Or maybe in the XAML , but I didn't find how to do it.

Is there a good tutorial somewhere I can read/follow? I didn't find any with Google, it just find C# stuff.

Thanks ps : sorry for my average English.

0

There are 0 answers