title: Binding when element is instantiated in code behind
body: <p>I have two properties that need to be binded. One is Value and it is the UserControl's property and the second one is property from an image element. The image element is inside Window. The Window is intestated in the code behind (UserControl). </p>
  
  <p>What do I need to add to enable proper binding between image src and property Value. The code is shown below.</p>
  
  <pre><code>&lt;UserControl x:Class="nnnn"&gt;
  
  &lt;UserControl.Resources&gt;
      &lt;propSheet:BitmapConverter x:Key="bitmapConverter" /&gt;
  
      &lt;Window x:Key="imagePopup"
              Width="640"
              Height="480"&gt;
          &lt;Grid Background="LightGray"&gt;
              &lt;Image Grid.Row="0" Source="{Binding Path=Value, Converter={StaticResource bitmapConverter}}" /&gt;
  
              &lt;TextBlock Text="{Binding Path=Value}"&gt;&lt;/TextBlock&gt;
  
              &lt;Button Grid.Row="1"
                      Width="25"
                      HorizontalAlignment="Left"
                      VerticalAlignment="Bottom"
                      Click="OpenFile_Click"&gt;
                  ...
              &lt;/Button&gt;
          &lt;/Grid&gt;
      &lt;/Window&gt;
  
  &lt;/UserControl.Resources&gt;
  
  &lt;Grid&gt;
      &lt;Button Click="ViewImage_Click"&gt;View Image&lt;/Button&gt;
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>