VisualTreeHelper::HitTest doesn't check for IsHitTestVisible property ?
So I have a border element with its IsHitTestVisible property is set to False.
However, when I performed VisualTreeHelper::HitTest on top of it, the border is returned as the hit element.
Is it a bug ? Thanks.
Code: Select all
<Border BorderThickness="10" BorderBrush="Red" IsHitTestVisible="False" Visibility="True">
</Border>
Is it a bug ? Thanks.
-
sfernandez
Site Admin
- Posts: 3014
- Joined:
Re: VisualTreeHelper::HitTest doesn't check for IsHitTestVisible property ?
It is not a bug, we are following the same behavior as WPF. It was strange for me also, but it is correct.
The property IsHitTestVisible is only used to generate Mouse events.
You can use the delegate version of HitTest if you need to skip elements with IsHitTestVisible=False.
The property IsHitTestVisible is only used to generate Mouse events.
You can use the delegate version of HitTest if you need to skip elements with IsHitTestVisible=False.
Re: VisualTreeHelper::HitTest doesn't check for IsHitTestVisible property ?
Great. I am able to bypass the element with IsHitTestVisible=false using the delegate version of HitTest.
Thanks.
Thanks.
-
sfernandez
Site Admin
- Posts: 3014
- Joined:
Re: VisualTreeHelper::HitTest doesn't check for IsHitTestVisible property ?
Ok, marked this as solved.
Who is online
Users browsing this forum: No registered users and 1 guest