I am using following code -
<Label Grid.Row="0" Content="{Binding MyColor}">
<Label.Background>
<SolidColorBrush Color="{Binding MyColor}"></SolidColorBrush>
</Label.Background>
</Label>
<Grid Grid.Row="1" Grid.Column="0">
<ScrollViewer Name="MyScroll"
Template="{DynamicResource MyScrollViewerControlTemplate}">
<ListView Name="List1"
BorderThickness="0"
SelectedItem="{Binding Path=SelectedElement}"
ItemsSource="{Binding Path=Elements}"
Background="{StaticResource aColor}">
<ListView.Resources>
<ControlTemplate x:Key="SelectedTemplate"
TargetType="ListViewItem">
<Border Cursor="Hand">
<Border.Background>
<SolidColorBrush Color="{Binding Path=myColor}">
</SolidColorBrush>
</Border.Background>
<TextBlock Text="Test" />
</Border>
</ControlTemplate>
</ListView.Resources>
</ListView>
</ScrollViewer>
</Grid>
Here when I am using property myColor to set Background color for label, It is working fine but when I am doing the same in ListView it is not working.
What have I missed. Please suggest.