public static void RemoveStylusDownHandler(DependencyObject element, StylusDownEventHandler handler) { if (element == null) { throw new ArgumentNullException("element"); } if (handler == null) { throw new ArgumentNullException("handler"); } if (element is UIElement) { ((UIElement)element).RemoveHandler(StylusDownEvent, handler); } else if (element is ContentElement) { ((ContentElement)element).RemoveHandler(StylusDownEvent, handler); } else { throw new NotSupportedException(); } }
public static void AddStylusDownHandler(System.Windows.DependencyObject element, StylusDownEventHandler handler) { }
/// <summary> /// Removes a handler for the StylusDown 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 RemoveStylusDownHandler(DependencyObject element, StylusDownEventHandler handler) { UIElement.RemoveHandler(element, StylusDownEvent, handler); }
/// <summary> /// Adds a handler for the StylusDown 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 AddStylusDownHandler(DependencyObject element, StylusDownEventHandler handler) { UIElement.AddHandler(element, StylusDownEvent, handler); }
///////////////////////////////////////////////////////////////////// /// <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) { StylusDownEventHandler handler = (StylusDownEventHandler)genericHandler; handler(genericTarget, this); }
public static void RemoveStylusDownHandler (DependencyObject element, StylusDownEventHandler handler) { if (element == null) throw new ArgumentNullException ("element"); if (handler == null) throw new ArgumentNullException ("handler"); if (element is UIElement) ((UIElement)element).RemoveHandler (StylusDownEvent, handler); else if (element is ContentElement) ((ContentElement)element).RemoveHandler (StylusDownEvent, handler); else throw new NotSupportedException (); }