title: Xaml Trigger Parent via a specific property of any child in Collection
body: <p>I'm having troubles with triggers for a Child-Parent relation in my ViewModel.</p>
  
  <p>Consider the following ViewModel (implements<code>INotifyPropertyChanged</code>) and View:</p>
  
  <pre><code>ViewModelType
   + Items: ObservableCollection&lt;ViewModelType&gt;
   + IsVisible: bool
   + Text: string
  
  ViewType
   + Visibility: Visibility
   + Header: string
  </code></pre>
  
  <p>I have a DataTemplate to bind the 2:</p>
  
  <pre><code>&lt;DataTemplate DataType="{x:Type vm:ViewModelType}"&gt;
    &lt;views:ViewType Header="{Binding Text}"/&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>And a style for the View:</p>
  
  <pre><code>&lt;Style TargetType="{x:Type views:ViewType}"&gt;
    &lt;Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource Bool2Visibility}}"/&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>This all works beautifully.</p>
  
  <p>Now, what I want to achieve is that if from ViewModelTypeInstanceA <em>all</em> <code>ViewModelType.Items</code> have their <code>IsVisible</code> property set to <code>false</code>, I want ViewModelTypeInstanceA corresponding <code>ViewType</code> to have its <code>Visibility</code> property set to <code>Visibility.Collapsed</code>**.<br/></p>
  
  <p>I have tried DataTriggers, converters and all but I don't think I can use something like AncestorType in triggers to non referable parent? It seems impossible to trigger a parent property. Perhaps it's possible for an element to observe all it's children's IsVisisble properties?</p>
  
  <p>Conditions:<br/>
  1. I prefer to NOT alter the ControlTemplate (it's from a diff lib).<br/>
  2. Modifying the ViewModel structure isn't an option either (compatibility issues). That means I cannot maintain a property <code>Parent</code> on item creation or alter the Collection type as Eli suggested.<br/>
  3. I really prefer an elegant solution.</p>
  
  <p>**Ofcourse depending on the children's ViewType's VisibilityProperty is also OK, if it can be set through styling.</p>