title: The height of the combobox changes when I select an item
body: <p>I have a combobox that binds to a collection in which I want to collapse some of them according to a condtion.</p>
  <p>The problem is that if in my view model I select an item that it is collapsed in my view, still is displayed the text of the DisplayMemeberPath, so I am trying to set the text of the texblock to an empty string.</p>
  <p>I think that I get it, the problem with my solution it is that the hight of the combobx changes when I select and item, so the height it is very few and I can't see the combobox completely.</p>
  <p>The code that I am using is this:</p>
  <pre><code>&lt;ComboBox
          ItemsSource=&quot;{x:Static vg:MyCOllection}&quot;
          SelectedItem=&quot;{Binding MySelectedItem}&quot;&gt;
      
      &lt;ComboBox.ItemContainerStyle&gt;
          &lt;Style TargetType=&quot;ComboBoxItem&quot;&gt;
              &lt;Setter Property=&quot;Visibility&quot; Value=&quot;Collapsed&quot;/&gt;
              &lt;Style.Triggers&gt;
                  &lt;DataTrigger Binding=&quot;{Binding MyCondition}&quot; Value=&quot;True&quot;&gt;
                      &lt;Setter Property=&quot;Visibility&quot; Value=&quot;Visible&quot;/&gt;
                  &lt;/DataTrigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
      &lt;/ComboBox.ItemContainerStyle&gt;
  
      &lt;ComboBox.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;DataTemplate.Triggers&gt;
                  &lt;DataTrigger Binding=&quot;{Binding MyCondition}&quot; Value=&quot;true&quot;&gt;
                      &lt;Setter Property=&quot;TextBlock.Text&quot; Value=&quot;{Binding MyPropertyInItem}&quot;/&gt;
                  &lt;/DataTrigger&gt;
                  &lt;DataTrigger Binding=&quot;{Binding MyCondition}&quot; Value=&quot;false&quot;&gt;
                      &lt;Setter Property=&quot;TextBlock.Text&quot; Value=&quot;&quot;/&gt;
                  &lt;/DataTrigger&gt;
              &lt;/DataTemplate.Triggers&gt;
          &lt;/DataTemplate&gt;
      &lt;/ComboBox.ItemTemplate&gt;
  &lt;/ComboBox&gt;
  </code></pre>
  <p>Perhaps there are better ways to achieve, so I could accept another solutions, how to set the text of the text block in the case the selected item is one of the items collapsed in the combobox.</p>
  <p>Thanks.</p>