title: Set Image as Button Background through XAML
body: <p>I am trying to set a image as a background of a button through XAML. I have a value converter that converts the icon path and returns a Bitmap Image</p>
  
  <pre><code>public static BitmapImage GetImage(String name)
  { 
        //return new BitmapImage from the location of the Path
  }
  </code></pre>
  
  <p>I tried directly setting the Image object as a Content of the Button but that didnt work. Then I tried setting the Source Of the ImageBrush Tag in the Button.BackGround but that still doesnt work.</p>
  
  <pre><code>&lt;Button  Margin="3" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0"&gt;
      &lt;Button.Background&gt;
          &lt;ImageBrush ImageSource="{Binding Path=IconPath, Converter={StaticResource ImageSourceConverter}}" /&gt;
      &lt;/Button.Background&gt;
  &lt;/Button&gt;
  </code></pre>
  
  <p>Its not specifically the problem with the Converter since the Same logic works to display the images in my treeview nodes. What am I doing wrong here?</p>