1

我有一个MultiBinding调用转换器DataGrid的属性。CellStyle

<Setter Property="CellStyle">
  <Setter.Value>
    <Style TargetType="{x:Type DataGridCell}">
      <Setter Property="Background">
        <Setter.Value>
          <MultiBinding Converter="{StaticResource TheConverter}">
            <MultiBinding.Bindings>
               <Binding RelativeSource="{RelativeSource Self}"/>
               <Binding Path="SpecificColorList" RelativeSource="{RelativeSource AncestorType=local:BADataGrid}" Mode="OneWay"/>
            </MultiBinding.Bindings>
          </MultiBinding>
        </Setter.Value>
      </Setter>
    </Style>
  </Setter.Value>
</Setter>

当我初始化DataGrid's source ( ObservableCollection)时,每个单元格都会调用转换器(当然......)。现在我想补充一点,每次单元格的值发生变化时都会调用转换器。我怎样才能做到这一点?

4

0 回答 0