I am really new to WPF and i was working on making a legend which has rectangles and information. Here is an example of the Legend
here is the xmal
<ItemsControl Name="icColorInfo" ItemsSource="{Binding m_legendInfo}"
BorderBrush="DarkBlue" BorderThickness="2">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="2,2,2,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="0" Height="25" Width="30" Fill="{Binding Color}"></Rectangle>
<TextBlock Grid.Column="1" Text="{Binding Info}"></TextBlock>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
The rectangle Fill binds to the color property of my legend class and the textblock binds to the info property
Now what i want to do is, if the legend "Info" entry equals "Empty", i want the rectangle to have a dashed border (maybe set the Stroke property or something)
How can i bind to a specific item without affecting other items?