private RotationGestureDetector rotationGestureDetector = null;
private int configGestureCount = 0;
private bool dispatchTouchEvents = true;
+ private bool dispatchParentTouchEvents = true;
private bool dispatchGestureEvents = true;
private bool dispatchParentGestureEvents = true;
private string internalName = string.Empty;
}
/// <summary>
+ /// Gets or sets the status of whether touch events can be dispatched to the parent.
+ /// If a View's DispatchParentTouchEvents is set to false, then parents will not receive a touch event signal either.
+ /// This works without adding a TouchEvent callback in the View.
+ /// <note>
+ /// If the <see cref="Tizen.NUI.BaseComponents.View.Sensitive"/> is a property that determines whether or not to be hittable, then this property prevents the propagation of the hit touch event.
+ /// </note>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool DispatchParentTouchEvents
+ {
+ get
+ {
+ return dispatchParentTouchEvents;
+ }
+ set
+ {
+ if (dispatchParentTouchEvents != value)
+ {
+ dispatchParentTouchEvents = value;
+ if (dispatchParentTouchEvents == false)
+ {
+ TouchEvent += OnDispatchParentTouchEvent;
+ }
+ else
+ {
+ TouchEvent -= OnDispatchParentTouchEvent;
+ }
+ }
+ }
+ }
+
+ private bool OnDispatchParentTouchEvent(object source, View.TouchEventArgs e)
+ {
+ return true;
+ }
+
+ /// <summary>
/// Gets or sets the status of whether the view should emit Gesture event signals.
/// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
/// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
NUILog.Error("touchData should not be null!");
return true;
}
-
+
TouchEventArgs e = new TouchEventArgs();
e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
return HitTest(e.Touch);
consumed = HandleControlStateOnTouch(e.Touch);
}
+ if (DispatchParentTouchEvents == false)
+ {
+ NUILog.Debug("If DispatchParentTouchEvents is false, it can not dispatch to parent.");
+ return true;
+ }
+
return consumed;
}