title: Bind image to datagrid using resources
body: <p>I am trying to retrieve the image from resource file and tryin to bind it to the datagrid of my WPF application.</p>
  
  <p>The datagrid is somewhat like this:</p>
  
  <pre><code>&lt;DataGridTemplateColumn Header="Image" Width="45"&gt;
    &lt;DataGridTemplateColumn.CellTemplate&gt;
                      &lt;DataTemplate&gt;
                          &lt;Image  Source="{Binding Path=Icon}" /&gt;
                      &lt;/DataTemplate&gt;
   &lt;/DataGridTemplateColumn.CellTemplate&gt;
  </code></pre>
  
  <p></p>
  
  <p>And Image is a property of type image of my MVVm class like this:</p>
  
  <pre><code> public Image Icon
      {
          get { return _licenseImage; }
          set { _licenseImage = value;
          PropertChanged("Icon");}
      }
  </code></pre>
  
  <p>And in the code behind Im tryin to do something like this to get image from resource file and tryin to bind it to datagrid column.</p>
  
  <pre><code>ResourceManager resourceManager = 
          new ResourceManager("Resources.Images", Assembly.GetExecutingAssembly());
  BitMap bitmap = resourceManager.GetObject("okimage") as BitMap;
  
  Image image = bitmap;
  return image;
  </code></pre>
  
  <p>I can see that image is populated but it is not displaying in the grid.</p>