How to allow an event to reach other UI elements?

Asked

Viewed 35 times

1

I own a xaml that I apply a rectangle over several images, in order to be able to manipulate them after a holding on them. The problem is that if I put the IsHitTestVisible in a state false in the rectangle and, when one of the images Holding, i update the state of IsHitTestVisible for true, the rectangle in triggers events such as ManipulationDelta, the finger of the touchscreen and put it back to trigger the events in my rectangle.

What I have of problem is similar to that question from Soen, despite having no answer, they cite techniques of reflection and the use of routed events, however it did not solve my problem because I do not know how to use properly or because it is not really the appropriate solution. Could you give me an example of how to solve this problem?

  • Pole the XAML to facilitate understanding. @Felipe-Velar

1 answer

0


After searching a lot, the solution found was to use the VisualTreeHelper.FindElementsInHostCoordinates. Hence what was done was the following: First we left active the rectangle that is on the images and added the event of Holding on it, then I use the FindElementsInHostCoordinates to find the images underneath it and fire the event of Holding to the correct "son", since I can get all the interface elements that are under my finger. I believe this is the best way, but in case someone has a better one, please share.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.