首页 新闻 会员 周边 捐助

为什么下面代码存在二义性?请给出解决方法

0
悬赏园豆:5 [已解决问题] 解决于 2014-10-27 15:43
 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         }
風过无痕的主页 風过无痕 | 初学一级 | 园豆:13
提问于:2014-09-25 16:04
< >
分享
最佳答案
0

把base换成this试下

或者写成public Brush MyEnterBrush: 父类再试下

收获园豆:5
大志若愚 | 老鸟四级 |园豆:2138 | 2014-09-29 09:49
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册