我在WPF控件继承有问题。我创建了一个名为BaseUserControl的UserControl。我想让这个控件成为其他WPF用户控件的基本控件。所以我写了另一个叫做FirstComponent的UserControl。在下一步我不过在编译过程中改变了这种代码wpf - 用户控件继承
FirstComponent : UserControl
这个
FirstComponent : BaseControl
我得到这个错误
Partial declarations of 'controlinheritance.componenets.FirstComponent' must not specify different base classes
我应该怎么做,使FirstComponent从BASECONTROL派生?
编辑 感谢abhishek答案我设法继承控件。我有另一个问题。在基类中,我指定了一个属性public Grid _MainGrid {get;组; }。现在我想在我的派生类中创建这个网格的一个实例。所以我用这个代码 Howerver我得到一个错误属性'_MainGrid'没有值。 Line 8 Position 36.
感谢它帮了我很多。你能看看我的edigted消息 – Berial 2010-10-20 21:08:32