我需要我所有的用户控件都具有一些类似的功能。所以我的用户控件是:
using System.Windows.Controls;
namespace WpfApplication26
{
/// <summary>
/// Interaction logic for UserControl1.xaml
/// </summary>
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
}
}
好的,现在我想让那个控件继承自一个基类,我在基类中拥有我的所有功能,因此我现在有类似的东西:
我张贴了一张图片来向你们展示我遇到的错误。 UserControl1 应该可以继承自 DraggableControl 因为 DraggableControl 继承自 UserControl。我不明白为什么 visual studio 不允许我编译该代码。
最佳答案
关于c# - 为什么 UserControl 不可能从 UserControl 以外的东西继承,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7895769/