public static void RemoveStylusButtonUpHandler(DependencyObject element, StylusButtonEventHandler handler) { if (element == null) { throw new ArgumentNullException("element"); } if (handler == null) { throw new ArgumentNullException("handler"); } if (element is UIElement) { ((UIElement)element).RemoveHandler(StylusButtonUpEvent, handler); } else if (element is ContentElement) { ((ContentElement)element).RemoveHandler(StylusButtonUpEvent, handler); } else { throw new NotSupportedException(); } }
public static void AddStylusButtonUpHandler(System.Windows.DependencyObject element, StylusButtonEventHandler handler) { }
public static void RemoveStylusButtonDownHandler(System.Windows.DependencyObject element, StylusButtonEventHandler handler) { }
/// <summary> /// Removes a handler for the PreviewStylusButtonUp 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 RemovePreviewStylusButtonUpHandler(DependencyObject element, StylusButtonEventHandler handler) { UIElement.RemoveHandler(element, PreviewStylusButtonUpEvent, handler); }
/// <summary> /// Adds a handler for the PreviewStylusButtonDown 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 AddPreviewStylusButtonDownHandler(DependencyObject element, StylusButtonEventHandler handler) { UIElement.AddHandler(element, PreviewStylusButtonDownEvent, handler); }
/// <summary> /// Adds a handler for the StylusButtonUp 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 AddStylusButtonUpHandler(DependencyObject element, StylusButtonEventHandler handler) { UIElement.AddHandler(element, StylusButtonUpEvent, handler); }
/// <summary> /// Removes a handler for the StylusButtonDown 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 RemoveStylusButtonDownHandler(DependencyObject element, StylusButtonEventHandler handler) { UIElement.RemoveHandler(element, StylusButtonDownEvent, handler); }
public static void RemoveStylusButtonUpHandler (DependencyObject element, StylusButtonEventHandler handler) { if (element == null) throw new ArgumentNullException ("element"); if (handler == null) throw new ArgumentNullException ("handler"); if (element is UIElement) ((UIElement)element).RemoveHandler (StylusButtonUpEvent, handler); else if (element is ContentElement) ((ContentElement)element).RemoveHandler (StylusButtonUpEvent, handler); else throw new NotSupportedException (); }
public static void AddPreviewStylusButtonDownHandler (DependencyObject element, StylusButtonEventHandler handler) { if (element == null) throw new ArgumentNullException ("element"); if (handler == null) throw new ArgumentNullException ("handler"); if (element is UIElement) ((UIElement)element).AddHandler (PreviewStylusButtonDownEvent, handler); else if (element is ContentElement) ((ContentElement)element).AddHandler (PreviewStylusButtonDownEvent, 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) { StylusButtonEventHandler handler = (StylusButtonEventHandler)genericHandler; handler(genericTarget, this); }