1 public static readonly DependencyProperty MyEnterBrushProperty = DependencyProperty.Register("MyEnterBrush", typeof(Brush), typeof(WMTabItem), new PropertyMetadata(null)); 2 public static readonly DependencyProperty MyMoverBrushProperty = DependencyProperty.Register("MyMoverBrush", typeof(Brush), typeof(WMTabItem), new PropertyMetadata(null)); 3 4 public Brush MyEnterBrush 5 { 6 get 7 { 8 return (base.GetValue(MyEnterBrushProperty) as Brush); 9 } 10 set 11 { 12 base.SetValue(MyEnterBrushProperty, value); 13 } 14 } 15 16 public Brush MyMoverBrush 17 { 18 get 19 { 20 21 return (base.GetValue(MyMoverBrushProperty) as Brush); 22 } 23 set 24 { 25 base.SetValue(MyMoverBrushProperty, value); 26 } 27 }
把base换成this试下
或者写成public Brush MyEnterBrush: 父类再试下