public static void AddStylusSystemGestureHandler(DependencyObject element, StylusSystemGestureEventHandler handler) { if (element == null) { throw new ArgumentNullException("element"); } if (handler == null) { throw new ArgumentNullException("handler"); } if (element is UIElement) { ((UIElement)element).AddHandler(StylusSystemGestureEvent, handler); } else if (element is ContentElement) { ((ContentElement)element).AddHandler(StylusSystemGestureEvent, handler); } else { throw new NotSupportedException(); } }
public static void AddPreviewStylusSystemGestureHandler(System.Windows.DependencyObject element, StylusSystemGestureEventHandler handler) { }
/// <summary> /// Removes a handler for the StylusSystemGesture attached event /// </summary> /// <param name="element">UIElement or ContentElement that listens to this event</param> /// <param name="handler">Event Handler to be removed</param> public static void RemoveStylusSystemGestureHandler(DependencyObject element, StylusSystemGestureEventHandler handler) { UIElement.RemoveHandler(element, StylusSystemGestureEvent, handler); }
/// <summary> /// Adds a handler for the PreviewStylusSystemGesture attached event /// </summary> /// <param name="element">UIElement or ContentElement that listens to this event</param> /// <param name="handler">Event Handler to be added</param> public static void AddPreviewStylusSystemGestureHandler(DependencyObject element, StylusSystemGestureEventHandler handler) { UIElement.AddHandler(element, PreviewStylusSystemGestureEvent, handler); }
/// <summary> /// Removes a handler for the StylusSystemGesture attached event /// </summary> /// <param name="element">UIElement or ContentElement that listens to this event</param> /// <param name="handler">Event Handler to be removed</param> public static void RemoveStylusSystemGestureHandler(DependencyObject element, StylusSystemGestureEventHandler handler) { UIElement.RemoveHandler(element, StylusSystemGestureEvent, handler); }
/// <summary> /// Adds a handler for the PreviewStylusSystemGesture attached event /// </summary> /// <param name="element">UIElement or ContentElement that listens to this event</param> /// <param name="handler">Event Handler to be added</param> public static void AddPreviewStylusSystemGestureHandler(DependencyObject element, StylusSystemGestureEventHandler handler) { UIElement.AddHandler(element, PreviewStylusSystemGestureEvent, handler); }
public static void RemoveStylusSystemGestureHandler (DependencyObject element, StylusSystemGestureEventHandler handler) { if (element == null) throw new ArgumentNullException ("element"); if (handler == null) throw new ArgumentNullException ("handler"); if (element is UIElement) ((UIElement)element).RemoveHandler (StylusSystemGestureEvent, handler); else if (element is ContentElement) ((ContentElement)element).RemoveHandler (StylusSystemGestureEvent, handler); else throw new NotSupportedException (); }
///////////////////////////////////////////////////////////////////// /// <summary> /// The mechanism used to call the type-specific handler on the /// target. /// </summary> /// <param name="genericHandler"> /// The generic handler to call in a type-specific way. /// </param> /// <param name="genericTarget"> /// The target to call the handler on. /// </param> protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) { StylusSystemGestureEventHandler handler = (StylusSystemGestureEventHandler)genericHandler; handler(genericTarget, this); }
public static void AddPreviewStylusSystemGestureHandler(System.Windows.DependencyObject element, StylusSystemGestureEventHandler handler) { }