title: WPF Designer keeps crashing when I put StackPanels in my ComboBoxItems
body: <p>I've been using WPF for around 8 months and I'm very comfortable in it. Using some questions and discussions I found on here, I learnt how to make my ComboBoxes stand out even more. but here's the thing, to put images and those items inside of a ComboBox item, I would have to wrap them in a Panel (whether it be a StackPanel or a WrapPanel), but whenever I do that the designer either doesn't load them correctly at all or just crashes. Everything shows perfectly when the application is launches </p>
  
  <p>Here's my code, nothing out of the ordinary. And I'm using <a href="https://docs.microsoft.com/en-us/dotnet/framework/wpf/controls/combobox-styles-and-templates" rel="nofollow noreferrer">this style</a> which is stored in a resource dictionary. Is there a way to make the code better or is the designer simply not smart enough?</p>
  
  <pre><code>&lt;!-- COmbo Box --&gt;
              &lt;ComboBox Margin="0 5 15 0" SelectedIndex="0"&gt;
  
                  &lt;!-- All Items --&gt;
                  &lt;ComboBox.Items&gt;
  
                      &lt;!-- General --&gt;
                      &lt;ComboBoxItem Margin="5 0 0 0"&gt;
  
                          &lt;!-- Content --&gt;
                          &lt;ComboBoxItem.Content&gt;
  
                              &lt;!-- Panel --&gt;
                              &lt;StackPanel Orientation="Horizontal"&gt;
  
                                  &lt;!-- Image --&gt;
                                  &lt;Image Source="/Icons/Support Ticket/feedstar.png" Height="10" /&gt;
  
                                  &lt;!-- Text --&gt;
                                  &lt;TextBlock Margin="10 0 0 0"&gt;
                                      General Support Request
                                  &lt;/TextBlock&gt;
                              &lt;/StackPanel&gt;
                          &lt;/ComboBoxItem.Content&gt;
                      &lt;/ComboBoxItem&gt;
  
                      &lt;!-- Display --&gt;
                      &lt;ComboBoxItem x:Name="CmbBxDisplay" Margin="5 0 0 0"&gt;
  
                          &lt;!-- Content --&gt;
                          &lt;ComboBoxItem.Content&gt;
  
                              &lt;!-- Panel --&gt;
                              &lt;StackPanel Orientation="Horizontal"&gt;
  
                                  &lt;!-- Image --&gt;
                                  &lt;Image Source="/Icons/Support Ticket/monitor.png" Height="10" /&gt;
  
                                  &lt;!-- Text --&gt;
                                  &lt;TextBlock Margin="10 0 0 0"&gt;
                                      Monitor/ Display Issues
                                  &lt;/TextBlock&gt;
                              &lt;/StackPanel&gt;
                          &lt;/ComboBoxItem.Content&gt;
                      &lt;/ComboBoxItem&gt;
  
                      &lt;!-- Sound --&gt;
                      &lt;ComboBoxItem Margin="5 0 0 0"&gt;
  
                          &lt;!-- Content --&gt;
                          &lt;ComboBoxItem.Content&gt;
  
                              &lt;!-- Panel --&gt;
                              &lt;StackPanel Orientation="Horizontal"&gt;
  
                                  &lt;!-- Image --&gt;
                                  &lt;Image Source="/Icons/Support Ticket/sound.png" Height="10" /&gt;
  
                                  &lt;!-- Text --&gt;
                                  &lt;TextBlock Margin="10 0 0 0"&gt;
                                      Sound Issues
                                  &lt;/TextBlock&gt;
                              &lt;/StackPanel&gt;
                          &lt;/ComboBoxItem.Content&gt;
                      &lt;/ComboBoxItem&gt;
  
                      &lt;!-- My Accoount --&gt;
                      &lt;ComboBoxItem Margin="5 0 0 0"&gt;
  
                          &lt;!-- Content --&gt;
                          &lt;ComboBoxItem.Content&gt;
  
                              &lt;!-- Panel --&gt;
                              &lt;StackPanel Orientation="Horizontal"&gt;
  
                                  &lt;!-- Image --&gt;
                                  &lt;Image Source="/Icons/Support Ticket/admin.png" Height="10" /&gt;
  
                                  &lt;!-- Text --&gt;
                                  &lt;TextBlock Margin="10 0 0 0"&gt;
                                      My Account
                                  &lt;/TextBlock&gt;
                              &lt;/StackPanel&gt;
                          &lt;/ComboBoxItem.Content&gt;
                      &lt;/ComboBoxItem&gt;
  
                      &lt;!-- Membership Support --&gt;
                      &lt;ComboBoxItem Margin="5 0 0 0"&gt;
  
                          &lt;!-- Content --&gt;
                          &lt;ComboBoxItem.Content&gt;
  
                              &lt;!-- Panel --&gt;
                              &lt;StackPanel Orientation="Horizontal"&gt;
  
                                  &lt;!-- Image --&gt;
                                  &lt;Image Source="/Icons/Support Ticket/memship.png" Height="15" /&gt;
  
                                  &lt;!-- Text --&gt;
                                  &lt;TextBlock Margin="5 0 0 0"&gt;
                                      Membership Support
                                  &lt;/TextBlock&gt;
                              &lt;/StackPanel&gt;
                          &lt;/ComboBoxItem.Content&gt;
                      &lt;/ComboBoxItem&gt;
  
                      &lt;!-- Contact Support --&gt;
                      &lt;ComboBoxItem Margin="5 0 0 0"&gt;
  
                          &lt;!-- Content --&gt;
                          &lt;ComboBoxItem.Content&gt;
  
                              &lt;!-- Panel --&gt;
                              &lt;StackPanel Orientation="Horizontal"&gt;
  
                                  &lt;!-- Image --&gt;
                                  &lt;Image Source="/Icons/Support Ticket/contacts.png" Height="15" /&gt;
  
                                  &lt;!-- Text --&gt;
                                  &lt;TextBlock Margin="5 0 0 0"&gt;
                                      Contacts Support
                                  &lt;/TextBlock&gt;
                              &lt;/StackPanel&gt;
                          &lt;/ComboBoxItem.Content&gt;
                      &lt;/ComboBoxItem&gt;
  
                      &lt;!-- Divine Service --&gt;
                      &lt;ComboBoxItem Margin="5 0 0 0"&gt;
  
                          &lt;!-- Content --&gt;
                          &lt;ComboBoxItem.Content&gt;
  
                              &lt;!-- Panel --&gt;
                              &lt;StackPanel Orientation="Horizontal"&gt;
  
                                  &lt;!-- Image --&gt;
                                  &lt;Image Source="/Icons/Support Ticket/bible.png" Height="15" /&gt;
  
                                  &lt;!-- Text --&gt;
                                  &lt;TextBlock Margin="10 0 0 0"&gt;
                                      Divine Service
                                  &lt;/TextBlock&gt;
                              &lt;/StackPanel&gt;
                          &lt;/ComboBoxItem.Content&gt;
                      &lt;/ComboBoxItem&gt; &lt;!-- End divine service --&gt;
  
                      &lt;!-- Announcements --&gt;
                      &lt;ComboBoxItem Margin="5 0 0 0"&gt;
  
                          &lt;!-- Content --&gt;
                          &lt;ComboBoxItem.Content&gt;
  
                              &lt;!-- Panel --&gt;
                              &lt;StackPanel Orientation="Horizontal"&gt;
  
                                  &lt;!-- Image --&gt;
                                  &lt;Image Source="/Icons/Support Ticket/announcement.png" Height="15" /&gt;
  
                                  &lt;!-- Text --&gt;
                                  &lt;TextBlock Margin="5 0 0 0"&gt;
                                      Announcements Support
                                  &lt;/TextBlock&gt;
                              &lt;/StackPanel&gt;
                          &lt;/ComboBoxItem.Content&gt;
                      &lt;/ComboBoxItem&gt;     &lt;!-- ENd Announcements --&gt;
  
                      &lt;!-- Reports and Audits --&gt;
                      &lt;ComboBoxItem Margin="5 0 0 0"&gt;
  
                          &lt;!-- Content --&gt;
                          &lt;ComboBoxItem.Content&gt;
  
                              &lt;!-- Panel --&gt;
                              &lt;StackPanel Orientation="Horizontal"&gt;
  
                                  &lt;!-- Image --&gt;
                                  &lt;Image Source="/Icons/Support Ticket/statistics.png" Height="15" /&gt;
  
                                  &lt;!-- Text --&gt;
                                  &lt;TextBlock Margin="5 0 0 0"&gt;
                                      Audits and Report Generating Assistance
                                  &lt;/TextBlock&gt;
                              &lt;/StackPanel&gt;
                          &lt;/ComboBoxItem.Content&gt;
                      &lt;/ComboBoxItem&gt;
  
                  &lt;/ComboBox.Items&gt;
              &lt;/ComboBox&gt;
  </code></pre>