title: DataTrigger RelativeSource WPF XAML
body: <p>The thing I want to make When mouseover in grid Border <em>Visibilty</em> property value must change.</p>
  
  <p>I have a grid with a 3 ColumnDefinition.</p>
  
  <p><a href="https://i.stack.imgur.com/nqQId.png" rel="nofollow"><img src="https://i.stack.imgur.com/nqQId.png" alt="enter image description here"></a></p>
  
  <p>The code is</p>
  
  <pre><code>&lt;Grid x:Name="grid1"&gt;
       &lt;Grid.ColumnDefinitions&gt;
            &lt;ColumnDefinition Width="5*"/&gt;
             &lt;ColumnDefinition Width="27*"/&gt;
             &lt;ColumnDefinition Width="93*"/&gt;
        &lt;/Grid.ColumnDefinitions&gt;
        &lt;Border Grid.Column="0" Background="Blue" Visibility="Hidden"&gt;
             &lt;Border.Style&gt;
                  &lt;Style&gt;
                     &lt;Style.Triggers&gt;
                      &lt;DataTrigger Binding="{Binding IsMouseOver , RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}}" Value="True"&gt;
                       &lt;Setter Property="Border.Visibility" Value="Visible" /&gt;
                       &lt;/DataTrigger&gt;
                       &lt;/Style.Triggers&gt;
                     &lt;/Style&gt;
                 &lt;/Border.Style&gt;
            &lt;/Border&gt;
          &lt;Image  Grid.Column="1" /&gt;
           &lt;TextBlock Grid.Column="2" /&gt;
  
     &lt;/Grid&gt;
  </code></pre>
  
  <p>When mouseover the grid nothing is happen.so This codes not working</p>