Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

VisualTreeHelper.HitTest does it always use the same search direction decide whats been hit?

$
0
0

VisualTreeHelper.HitTest does it always use the same search direction decide whats been hit?

I have a group of DrawingVisual's as children of on main DrawingVisual.

I associated names with each of the DrawngElements to figure which element got hit.

I found something out kind of weird... The last child DrawingVisual is checked first then previous child DrawingVisual etc. 

I know this from testing, two polygon rectangles one inside the other. I associate name one "outsideRect" and "insideRect"

If I add "insideRect" last it gets checked first and I can get a hit on it. If I add it before "outsideRect" I always get

"outsideRect" (since it surrounds inside rect.) 

This not logical to me, but, what I need to know is can I depend on this ? The direction of the hit testing..

Bob


bfxtech.com


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>