Odd"依赖属性字段缺失"错误

时间:2012-07-30 18:10:08

标签: wpf xaml resharper dependency-properties

ReSharper抱怨以下XAML:

        <ControlTemplate.Triggers>
          <MultiTrigger>
            <MultiTrigger.Conditions>
              <Condition Property="IsSelectionBoxHighlighted" Value="true"/>
              <Condition Property="IsDropDownOpen" Value="false"/>
            </MultiTrigger.Conditions>

控制模板当然是ComboBox。通过解决方案范围的检查,Resharper在Dependency property field missing上报告IsSelectionBoxHighlighted错误,但在IsDropDownOpen报告错误。我可能想到的唯一区别是IsSelectionBoxHighlighted是只读的,但是在这个实例中是否会产生影响?

这是一个Resharper错误,还是其他的东西在这里?这对任何人来说都很熟悉吗?

1 个答案:

答案 0 :(得分:2)

IsSelectionBoxHighlighted is not a DependencyProperty on the System.Windows.Controls.ComboBox class,而它似乎是Selected ComboBoxItem的访问器,其中DependencyProperty被称为IsHighlighted。

The property targeted by your Trigger must be a Dependency Property

另请查看this bug report