title: conditional binding in wpf?
body: <p>I am really new to WPF and i was working on making a legend which has rectangles and information.
  <a href="https://i.stack.imgur.com/3mKYX.png" rel="nofollow noreferrer">Here is an example of the Legend</a></p>
  
  <p>here is the xmal</p>
  
  <pre><code>        &lt;ItemsControl Name="icColorInfo" ItemsSource="{Binding m_legendInfo}" 
                    BorderBrush="DarkBlue" BorderThickness="2"&gt;
          &lt;ItemsControl.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;Grid Margin="2,2,2,2"&gt;
                      &lt;Grid.ColumnDefinitions&gt;
                          &lt;ColumnDefinition Width="100"/&gt;
                          &lt;ColumnDefinition Width="*"/&gt;
                      &lt;/Grid.ColumnDefinitions&gt;
                      &lt;Rectangle Grid.Column="0" Height="25" Width="30" Fill="{Binding Color}"&gt;&lt;/Rectangle&gt;
                      &lt;TextBlock Grid.Column="1" Text="{Binding Info}"&gt;&lt;/TextBlock&gt;
                  &lt;/Grid&gt;
              &lt;/DataTemplate&gt;
          &lt;/ItemsControl.ItemTemplate&gt;
      &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>The rectangle Fill binds to the color property of my legend class and
  the textblock binds to the info property</p>
  
  <p>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)</p>
  
  <p>How can i bind to a specific item without affecting other items?</p>