Binding MultiDataTrigger to a collection and to a property in a collection

I have the following XAML:

<Style.Triggers>

  <MultiDataTrigger>
    <MultiDataTrigger.Conditions>
      <Condition Binding="{Binding Path=Errors, Converter={StaticResource ErrorsCountConverter}}">
        <Condition.Value>True</Condition.Value>
      </Condition> 
      <Condition Binding="{Binding Path=Errors[0].HasError}" Value="True" />
    </MultiDataTrigger.Conditions>
    <Setter Property="Background" Value="Red" />
  </MultiDataTrigger>

</Style.Triggers>

Mistakes are this ObservableCollection<BrokenRule>. BrokenRule has a HasError property. Now I want to bind to this HasError property, but I'm not sure how to refer to it in XAML.

+1
source share
1 answer

. , , "{Binding Path=/}", , , HasError, , - "{Binding Path=Errors/HasError}" HasErrors Errors.

, !

+2

Source: https://habr.com/ru/post/1730558/


All Articles