WPF create style binding from code behind

Viewed 2014

I would like to create this styel in codebehind, but I don't know how to set the binding to the datagrid row property.

 <UserControl.Resources>
    <Style x:Key="MyStyle" TargetType="{x:Type DataGridCell}">
        <Setter Property="Background" Value="{Binding SelectedColour[0]}" />
    </Style>
</UserControl.Resources>

How can I do it? Thank you Andrea

1 Answers
Related