How to Update the bool Property based on Button Visibility in DataGridColumnHeader Style
<p>I'm having filter Icon style implemented for the Target Type = DataGridColumnHeader and I attached the Style in DataGrid.</p>

<p>My Requirement is to Update the ViewModel <code>bool Property</code> <code>HasFilterIcon</code> to <code>true</code> if any one of the <code>button</code> within the <code>DataGridColumnHeader</code> gets the <code>visibility visible</code> otherwise <code>false</code></p>

<p>My XAML Style is</p>

<pre><code>&lt;Style TargetType="{x:Type DataGridColumnHeader}" x:Key="DataGridElementStyle"&gt;
   &lt;Setter Property="Template"&gt;
      &lt;Setter.Value&gt;
          &lt;ControlTemplate TargetType="{x:Type DataGridColumnHeader}"&gt;
              &lt;Button Name="autofilter" Command="{Binding Path=DataContext.FilterPopUpCommand, 
                                  RelativeSource={RelativeSource Mode=FindAncestor, 
                                                  AncestorType={x:Type Window}}}"&gt;
                  &lt;Button.CommandParameter&gt;
                      &lt;MultiBinding Converter="{StaticResource MultiValueConverterKey}"&gt;
                          &lt;Binding RelativeSource="{ RelativeSource Mode=FindAncestor, 
                                                     AncestorType={x:Type cust:DataGrid}}" /&gt;
                          &lt;Binding Path="Column" 
                                   RelativeSource="{RelativeSource Mode=TemplatedParent}" /&gt;
                      &lt;/MultiBinding&gt;
                  &lt;/Button.CommandParameter&gt;
              &lt;/Button&gt;
              &lt;ControlTemplate.Triggers&gt;
                    &lt;MultiTrigger&gt;
                        &lt;MultiTrigger.Conditions&gt;
                            &lt;Condition Property="IsMouseOver" Value="True"&gt;&lt;/Condition&gt;
                        &lt;/MultiTrigger.Conditions&gt;
                        &lt;Setter TargetName="autofilter" Property="Visibility" Value="Visible"/&gt;
                    &lt;/MultiTrigger&gt;
                &lt;/ControlTemplate.Triggers&gt;
          &lt;/ControlTemplate&gt;
      &lt;/Setter.Value&gt;
   &lt;/Setter&gt;
&lt;/Style&gt;
</code></pre>

<p>My XAML DataGrid is</p>

<pre><code>&lt;DataGrid Name="PassengerGrid" AutoGenerateColumns="False"  ColumnHeaderStyle="{StaticResource FilterDataGridColumnHeader}"&gt;
     &lt;DataGridTextColumn Binding="{Binding CustomVisitTime}"  Header="Visit Time" CanUserSort="true" Width="90" ElementStyle="{StaticResource DataGridElementStyle}""/&gt;
     &lt;DataGridTextColumn Binding="{Binding PassengerName}"  Header="Passenger Name" CanUserSort="true" Width="90" ElementStyle="{StaticResource DataGridElementStyle}""/&gt;
&lt;/DataGrid&gt;
</code></pre>

<p>The Property which I need to Update is</p>

<pre><code>private bool _hasFilterIcon = false;
public bool HasFilterIcon
{
    get { return _hasFilterIcon; }
    set
    {
        _hasFilterIcon = value;
        OnPropertyChanged();
    }
}
</code></pre>

<p>If any of the Column Header Button gets the <code>Visibility Visible</code>, then I need to change the value of the <code>HasFilterIcon</code> to <code>true</code> otherwise <code>false</code>. Kindly assist me.</p>

<blockquote>
  <p>Note: The Style has N number of buttons, out of N I have to check is
  there is any one of the button is Visible...</p>
</blockquote>