title: Showing same xaml format image inside multiple dataGrid cells by utilising IValueConverter
body: <p>I have a working solution to convert boolean value into a xaml-image wrapped inside <code>&lt;Viewbox&gt;</code> by using <code>&lt;ContentControl&gt;</code> as follows:</p>
  
  <pre><code>&lt;DataGridTemplateColumn&gt;
      &lt;DataGridTemplateColumn.CellTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;ContentControl Content="{Binding Recommended, Converter={StaticResource BoolImageConverter}}" Height="20"/&gt;
          &lt;/DataTemplate&gt;
      &lt;/DataGridTemplateColumn.CellTemplate&gt;
  &lt;/DataGridTemplateColumn&gt;
  </code></pre>
  
  <p>But with the above solution the converted image is only shown in the first cell. </p>
  
  <blockquote>
    <p>How can I properly use <code>&lt;ControlTemplate&gt;</code> or <code>&lt;Control&gt;</code> in this
    case?</p>
  </blockquote>
  
  <p><a href="https://stackoverflow.com/a/25681167/1069643">I have looked into this answer</a> but I'm unable to reproduce a working solution with the <code>Converter</code>. </p>
  
  <p>Example of the xaml-image</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
      &lt;Viewbox x:Key="Symbols.StarIcon"&gt;
          &lt;Canvas Width="46" Height="44" &gt;
             ...
          &lt;/Canvas&gt;
      &lt;/Viewbox&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>The Converter idea is from <a href="https://stackoverflow.com/a/3444817/1069643">this post</a>: </p>
  
  <pre><code>public class BoolToImage : IValueConverter
  {
      public Viewbox TrueImage { get; set; }
      public Viewbox FalseImage { get; set; }
  
      public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
      {
          if (!(value is bool))
          {
              return null;
          }
  
          bool b = (bool)value;
          if (b)
          {
              return this.TrueImage;
          }
          else
          {
              return this.FalseImage;
          }
      }
  
      public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
      {
          throw new NotImplementedException();
      }
  }
  </code></pre>