title: How to add a StackPanel in a Button in C# code behind
body: <p>How to add a <strong>StackPanel</strong> in a Button using c# code behind (i.e. convert the following XAML to C# )? There is no <code>Button.Children.Add</code>...</p>
  
  <pre><code>&lt;Button&gt;
     &lt;StackPanel Orientation="Horizontal" Margin="10"&gt;
        &lt;Image Source="foo.png"/&gt;
     &lt;/StackPanel&gt;
  &lt;/Button&gt;
  </code></pre>