0

I have a wormControl class, which should inherit from MyUserControl, but when building the solution, the wormControl is being inherited from UserControl. Anyway, I want it to inherit from MyUserControl. How to implement it?

Here is my XAML file for UserControl:

<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:System="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
x:Class="FishGameAnimations.wormControl"
d:DesignWidth="575" d:DesignHeight="339">
/* ...other stuff... */
</UserControl>
H.B.
  • 166,899
  • 29
  • 327
  • 400

1 Answers1

0

As it was said your base control has to be without XAML. All your design should be built from code behind. Look in the link given by Rafal. An example how to set base class for control

<Controls:MyUserControl x:Class="Termo.Win.Controls.ChildControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:Namespace.MyUserControl">
Artiom
  • 7,694
  • 3
  • 38
  • 45