title: Hide WPF ComboBox without visible items in XAML
body: <p>iIs there a pure XAML way to hide ComboBox when all its items are collapsed?</p>
  
  <p>For example, I have a combobox:</p>
  
  <pre><code>&lt;ComboBox ItemsSource="{Binding Persons}"&gt;
      &lt;ComboBox.ItemContainerStyle&gt;
          &lt;Style TargetType="{x:Type ComboBoxItem}"&gt;
              &lt;Setter Property="Visibility" Value="{Binding IsAlive, Converter={StaticResource BoolToVis}}" /&gt;
          &lt;/Style&gt;
      &lt;/ComboBox.ItemContainerStyle&gt;
  &lt;/ComboBox&gt;
  </code></pre>
  
  <p>Expected behavior: If all persons are dead, combobox is not visible, but if at least single person is alive, combobox is visible (and show only alive persons)</p>
  
  <p>I already implemented this behaviour in code using the <code>CollectionViewSource</code>, <code>Filter</code> and count of elements in <code>CollectionViewSource.View</code> after filter is applied, but I prefer to achieve that without code behing only in XAML.</p>
  
  <p><strong>EDIT:</strong>
  I need a universal solution usable in all ComboBoxes as part of style, not assigned with the Person type or IsAlive property... so a solution should depends only on visibility property of contained items</p>