title: How to create an Image inside a dynamic Border programmatically?
body: <p>I'm trying to create a <code>Border</code> dynamicaly and tryning to add an <code>Image</code> into it.Is that possible ?</p>
  
  <p><strong>C# :</strong> </p>
  
  <pre><code>private void AddToHistory()
  {
      HistoryBorder.Visibility = System.Windows.Visibility.Visible;
      Border Br = new Border();
      Br.BorderBrush = Brushes.Black;   
      Br.BorderThickness = new Thickness(2) ;                
      Image tem = new Image();
      tem.Source = image1.Source;
      Br.Content = tem;   // ?? Error here.  
      StackHistory.Children.Add(Br);   
  }
  </code></pre>
  
  <p><strong>XAML :</strong></p>
  
  <pre><code>&lt;Grid Grid.Column="2" x:Name="History"&gt;
    &lt;ScrollViewer&gt;
      &lt;Border x:Name="HistoryBorder" BorderThickness="4" CornerRadius="1" BorderBrush="#FFF2C683" Visibility="Hidden"&gt;
         &lt;StackPanel x:Name="StackHistory" HorizontalAlignment="Left" VerticalAlignment="Top" &gt;
         &lt;/StackPanel&gt;
      &lt;/Border&gt;
    &lt;/ScrollViewer&gt;
  &lt;/Grid&gt;
  </code></pre>