[NUI] Add a protected virtual bool HitTest(Touch touch) method.
In the case of TouchEvent or Gesture, there is no way to propagate the event to the view below that is not related.
So, in the hit-test process, called the virtual HitTest method to check whether it was hit or not.
User can override whether hit or not in HitTest.
If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
If it returns true, it means that it was hit, and the touch/gesture event is called from the view as before.
for example)
Override HitTest as below.
HitTest() is called when the View is hit.
If returned false, This means it will not be hit. Then the hit-test goes to the next view.
class MyView : View
{
protected override bool HitTest(Touch touch)
{
return false;
}
}
class Sample
{
public void Create()
{
View view = new MyView()
{
Size = new Size(100, 100),
}
view.TouchEvent += (s, e) =>
{
return false;
}
}
}