title: Create button with image programmatically
body: <p>In XAML it's easy to define a button with an image:</p>
  
  <pre><code>&lt;Button x:Name="btnSound"
          Click="SoundButton"
          Height="40"
          HorizontalAlignment="Left" 
          VerticalAlignment="Bottom" Margin="20,0"&gt;
      &lt;Image x:Name="speakerImg" Source="/png/btn_speak_i.png" /&gt;
  &lt;/Button&gt;
  </code></pre>
  
  <p>I want to do that in <code>c#</code>:</p>
  
  <pre><code>// Prepare two BitmapImages
  BitmapImage SoundDisable = new BitmapImage(new Uri("ms-appx:///png/btn_speak_i.png", 
      UriKind.RelativeOrAbsolute));
  BitmapImage SoundEnable = new BitmapImage(new Uri("ms-appx:///png/btn_speak.png", 
      UriKind.RelativeOrAbsolute));
  
  // Define and Load Button
  btnSound = new Button();
  btnSound.HorizontalAlignment = HorizontalAlignment.Left;
  btnSound.VerticalAlignment = VerticalAlignment.Bottom;
  Thickness margin = new Thickness(0,00,20,0);
  btnSound.Margin = margin;
  btnSound.Click += new RoutedEventHandler(btnSound_Click);
  btnSound.IsEnabled = false;
  topBar.Children.Add(btnSound);
  </code></pre>
  
  <p>I can find no way to add an image to the button. Something like</p>
  
  <pre><code>btnSound.Content = SoundDisable; 
  </code></pre>
  
  <p>Is not working. It shows only a text with the type of the image inside the button. In the XAML version, I set the Image with</p>
  
  <pre><code>speakerImg.Source = SoundDisable;
  </code></pre>
  
  <p>because the image is defined with an <code>x:Name</code>.</p>
  
  <p>How can I programmatically add a named image to my button?</p>