我们正在编写TextBox的自定义子类,我们只需要更改样式的一些基本部分。现在我们知道,当你继承Control,通常你应该改变这样的元数据... public class EnhancedTextBox : TextBox
{
static EnhancedTextBox()
{
// Commenting this line out lets this use
的风格,我使用的是从文本框继承的自定义文本框: Public Class MyTextBox: Inherits TextBox
...
End Class
我想这个类为使用中的经典定义的样式。 xaml ResourceDictionary。我尝试这样做: <Style x:Key="{x:Type uc:MyTextBox}" BasedOn="{StaticResource