0

is possible to binding the array's index e.g:

<Style x:Key="NameButtonStyle" TargetType="Button">
    <Setter Property="Visibility" Value="{Binding Array[{Binding custom property index}]}/>
</Style>
luka
  • 605
  • 8
  • 15
  • In addition to the link. You could alternatively use a multibinding and multiconverter. – Andy Aug 18 '20 at 15:33

1 Answers1

1

Only if the "index" is specified by a constant like for example 1:

<Style x:Key="NameButtonStyle" TargetType="Button">
    <Setter Property="Visibility" Value="{Binding Array[1]}/>
</Style>

You cannot replace 1 in the example above with a dynamic value that is resolved at runtime. If you need this, you'll have to use a converter or expose a property that returns Array[x] where x represents the dynamic value.

mm8
  • 163,881
  • 10
  • 57
  • 88