title: Add Image to Xaml with C#
body: <p>I have a stack panel in my XAML page.</p>
  
  <pre><code> &lt;StackPanel Name="xamlimg" Orientation="Vertical" Grid.column="1"&gt;
   &lt;/StackPanel&gt;
  </code></pre>
  
  <p>I want to add an image in this <code>stackpanel</code> using C# code behind the XAML page.</p>
  
  <p>I have attempted using the structure below, but I can't seem to set the source right.</p>
  
  <pre><code>Image img = new Image();
  img.Source= //Image Source here
  xamlimg.Children.Add(img);
  </code></pre>
  
  <p>How do I set the image source and add it to the <code>stackpanel</code>?</p>