title: Adding multiple content to a listbox. C#, WPF
body: <p>My WPF application has a listbox with multiple items. On each item, we have an image and a textbox.</p>
  
  <p>See XAML below:</p>
  
  <pre><code>      &lt;ListBox x:Name="lstMagic" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="10,200,10,0" Width="Auto" Height="558" Background="{x:Null}" BorderBrush="Transparent"&gt;
  
              &lt;ListBoxItem&gt;
                  &lt;StackPanel Orientation="Horizontal"&gt;
                      &lt;Image Source="images/plates/pig.jpg" Margin="0,0,5,0" Width="72"/&gt;
                      &lt;TextBox IsReadOnly="True"  Background="{x:Null}" Foreground="White" Width="912"&gt;Some Magic is going to happen&lt;/TextBox&gt;
                  &lt;/StackPanel&gt;
              &lt;/ListBoxItem&gt;
  </code></pre>
  
  <p>So the list begins with the pigs as expected. IN front of the pig, he loads the pig.jpg sucessfully.</p>
  
  <p>Beside that form section, I have a button. I was able to do some magic on that button to add a new listBoxItem.</p>
  
  <pre><code>        private void btnDoMagic(object sender, RoutedEventArgs e)
      {
          ListBoxItem newMagic = new ListBoxItem();
          Image imageCurrent = new Image();
          imageCurrent.Source = new BitmapImage(new Uri("images/plates/someOtherImage.jpg", UriKind.RelativeOrAbsolute));
          newMagic.Content = imageCurrent;
          lstCardapio.Items.Add(newMagic);
      }
  }
  </code></pre>
  
  <p>This function works, and adds the image successfully to the list! But I have some questions:
  How can I make just like my first XAML? An image and a textbox? How can I add these at my button event?</p>
  
  <p>I will need this done because we will get these items from our database, so we must load these dynamically.</p>