title: How to Disable DataTrigger based on Situation in WPF XAML?
body: <blockquote>
    <p>This is just a Sample Code</p>
  </blockquote>
  
  <p>In the Sample Code, I'm having 3 Buttons. Each button Visibility is Collapsed by Default, it will be Visible at the time of Mouse Hover in the respective Grid or Border.</p>
  
  <p>The names of the 3 Buttons are</p>
  
  <ol>
  <li>SupremeButton </li>
  <li>PowerButton </li>
  <li>StarButton</li>
  </ol>
  
  <p>PowerButton has an additional Trigger, when the Button gets Visible then it turns the <code>Background</code> Color to <strong>BlueViolet</strong>. But the default <code>Background</code> Color is <strong>BurlyWood</strong></p>
  
  <p>Additionally two DataTriggers are there for setting Visibility in PowerButton.</p>
  
  <ul>
  <li>If SupremeButton gets Visibility Visible then PowerButton turns the
  Visibility to Visible </li>
  <li><p>If StarButton gets Visibility Visible then PowerButton turns the
  Visibility to Visible</p>
  
  <p>Here my requirement is I need to Disable the DataTrigger of Background Color for the above said two DataTrigger gets effect. The Result should be the Default Color <strong>BurlyWood</strong>.</p></li>
  </ul>
  
  <blockquote>
    <p><strong>Note</strong>: Don't add any Condition in the above said DataTrigger to set the
    Background Color to BurlyWood. Share your idea, how to byepass the
    DataTrigger.</p>
  </blockquote>
  
  <p>My Sample WPF XAML Source Code is</p>
  
  <pre><code>&lt;Grid&gt;
      &lt;Border x:Name="m_Border" Width="100" Height="30" HorizontalAlignment="Center" VerticalAlignment="Top" Background="#FFF2FFC6" Margin="0,20,0,0"&gt;
          &lt;Button x:Name="SupremeButton" Content="iApp" HorizontalAlignment="Center" VerticalAlignment="Center" Width="75" &gt;
              &lt;Button.Style&gt;
                  &lt;Style&gt;
                      &lt;Style.Triggers&gt;
                          &lt;DataTrigger Binding="{Binding ElementName=m_Border, Path=IsMouseOver}" Value="false"&gt;
                              &lt;Setter Property="Button.Visibility" Value="Collapsed"&gt;&lt;/Setter&gt;
                          &lt;/DataTrigger&gt;
                      &lt;/Style.Triggers&gt;
                  &lt;/Style&gt;
              &lt;/Button.Style&gt;
          &lt;/Button&gt;
      &lt;/Border&gt;
      &lt;Grid x:Name="grid" Width="100" Height="30" HorizontalAlignment="Center" VerticalAlignment="Top" Background="#FFF2FFC6" Margin="0,60,0,0"&gt;
          &lt;Button x:Name="PowerButton" Content="iApp" HorizontalAlignment="Center" VerticalAlignment="Center" Background="BurlyWood" Width="75" &gt;
              &lt;Button.Style&gt;
                  &lt;Style&gt;
                      &lt;Style.Triggers&gt;
                          &lt;DataTrigger Binding="{Binding ElementName=grid, Path=IsMouseOver}" Value="false"&gt;
                              &lt;Setter Property="Button.Visibility" Value="Collapsed"&gt;&lt;/Setter&gt;
                          &lt;/DataTrigger&gt;
                          &lt;DataTrigger Binding="{Binding ElementName=PowerButton, Path=Visibility}" Value="Visible"&gt;
                              &lt;Setter Property="Button.Background" Value="BlueViolet"&gt;&lt;/Setter&gt;
                          &lt;/DataTrigger&gt;
  
                          &lt;!-- Visibilty is set by Outer Button --&gt;
                          &lt;DataTrigger Binding="{Binding ElementName=SupremeButton, Path=Visibility}" Value="Visible"&gt;
                              &lt;Setter Property="Button.Visibility" Value="Visible"&gt;&lt;/Setter&gt;
                          &lt;/DataTrigger&gt;
                          &lt;DataTrigger Binding="{Binding ElementName=StarButton, Path=Visibility}" Value="Visible"&gt;
                              &lt;Setter Property="Button.Visibility" Value="Visible"&gt;&lt;/Setter&gt;
                          &lt;/DataTrigger&gt;
  
                      &lt;/Style.Triggers&gt;
                  &lt;/Style&gt;
              &lt;/Button.Style&gt;
          &lt;/Button&gt;
      &lt;/Grid&gt;
      &lt;Border x:Name="n_Border" Width="100" Height="30" HorizontalAlignment="Center" VerticalAlignment="Top" Background="#FFF2FFC6" Margin="0,100,0,0"&gt;
          &lt;Button x:Name="StarButton" Content="iApp" HorizontalAlignment="Center" VerticalAlignment="Center" Width="75" &gt;
              &lt;Button.Style&gt;
                  &lt;Style&gt;
                      &lt;Style.Triggers&gt;
                          &lt;DataTrigger Binding="{Binding ElementName=n_Border, Path=IsMouseOver}" Value="false"&gt;
                              &lt;Setter Property="Button.Visibility" Value="Collapsed"&gt;&lt;/Setter&gt;
                          &lt;/DataTrigger&gt;
                      &lt;/Style.Triggers&gt;
                  &lt;/Style&gt;
              &lt;/Button.Style&gt;
          &lt;/Button&gt;
      &lt;/Border&gt;
  &lt;/Grid&gt;
  </code></pre>