title: WPF Image Source binding sometimes working sometimes not
body: <p>I ran into a bit of a problem when trying to bind Image Source. I'm creating a board game where you can select a player to view its attributes (including his image). Also the fields on the board have images as background.</p>
  
  <p>The template i created for the fields:</p>
  
  <pre><code>&lt;ControlTemplate x:Key="fieldButtonTemplate" x:Name="fieldButtonTemplateName" TargetType="{x:Type Button}"&gt;
      &lt;Grid x:Name="fieldGrid" Visibility="Visible"&gt;
          &lt;Grid.LayoutTransform&gt;
              &lt;RotateTransform Angle="{Binding ImageRotate}" /&gt;
          &lt;/Grid.LayoutTransform&gt;
          &lt;Grid.Background&gt;
              &lt;ImageBrush ImageSource="{Binding Path=ImageSource}"/&gt;
          &lt;/Grid.Background&gt;
          &lt;Grid.RowDefinitions&gt;
              ....
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid.ColumnDefinitions&gt;
            ...
          &lt;/Grid.ColumnDefinitions&gt;
      &lt;/Grid&gt;
  &lt;/ControlTemplate&gt;
  </code></pre>
  
  <p>And the one for viewing player attributes:</p>
  
  <pre><code>&lt;Image Source="{Binding Path=CurrentlySelected.ImageSource}" Grid.Column="0" Grid.Row="0"
                     Grid.ColumnSpan="2"  Stretch="Fill" /&gt;
  &lt;StackPanel x:Name="CurrentPlayerStackPanel"  Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2"&gt;
        &lt;TextBlock Text="{Binding Path=CurrentlySelected.Name}" TextWrapping="Wrap"
                             FontFamily="Magneto" FontSize="20" Foreground="BlanchedAlmond"/&gt;
        &lt;TextBlock Text="{Binding Path=CurrentlySelected.Character}" TextWrapping="Wrap"
                             FontFamily="Magneto" FontSize="20" Foreground="BlanchedAlmond"/&gt;
        &lt;TextBlock Text="{Binding Path=CurrentlySelected.Money}" TextWrapping="Wrap"
                             FontFamily="Magneto" FontSize="20" Foreground="BlanchedAlmond"/&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>The problem is that the image only shows upon selecting player and does not show as background to the grid. 
  I created an interface for both players and fields:</p>
  
  <pre><code>interface IVisualObject
  {
      int ImageRotate { get; set; }
      string ImageSource { get; set; }
  }
  </code></pre>
  
  <p>The images are resources, build action set to content and copy to output directory is set to copy if newer. The string i'm trying to pass as image source is like </p>
  
  <blockquote>
    <p>"pack://siteoforigin:,,,/Resources/picture.jpg"</p>
  </blockquote>
  
  <p>btw ImageRotate is binded just fine.
  Thanks in advance!</p>
  
  <p>EDIT:
  if i set it like</p>
  
  <pre><code>&lt;Grid.Background&gt;
       &lt;ImageBrush ImageSource="pack://siteoforigin:,,,/Resources/picture.jpg"/&gt;
  &lt;/Grid.Background&gt;
  </code></pre>
  
  <p>it works.</p>