/// <summary> /// Adds a handler for the PreviewStylusInRange 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 AddPreviewStylusInRangeHandler(DependencyObject element, StylusEventHandler handler) { UIElement.AddHandler(element, PreviewStylusInRangeEvent, handler); }
public static void AddPreviewStylusUpHandler(System.Windows.DependencyObject element, StylusEventHandler handler) { }
void RealButton_Loaded(object sender, RoutedEventArgs e) { Loaded -= RealButton_Loaded; Source = ImageUpSource; MouseLeftButtonDown += RealButton_MouseLeftButtonDown; MouseLeftButtonUp += RealButton_MouseLeftButtonUp; MouseEnter += RealButton_MouseEnter; MouseLeave += RealButton_MouseLeave; StylusUp += new StylusEventHandler(RealButton_StylusUp); }
/// <summary> /// Adds a handler for the StylusUp 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 AddStylusUpHandler(DependencyObject element, StylusEventHandler handler) { UIElement.AddHandler(element, StylusUpEvent, handler); }
public static void RemoveStylusOutOfRangeHandler(System.Windows.DependencyObject element, StylusEventHandler handler) { }
/// <summary> /// Removes a handler for the StylusOutOfRange 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 RemoveStylusOutOfRangeHandler(DependencyObject element, StylusEventHandler handler) { UIElement.RemoveHandler(element, StylusOutOfRangeEvent, handler); }
/// <summary> /// Removes a handler for the LostStylusCapture 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 RemoveLostStylusCaptureHandler(DependencyObject element, StylusEventHandler handler) { UIElement.RemoveHandler(element, LostStylusCaptureEvent, handler); }
public static void AddPreviewStylusOutOfRangeHandler (DependencyObject element, StylusEventHandler handler) { if (element == null) throw new ArgumentNullException ("element"); if (handler == null) throw new ArgumentNullException ("handler"); if (element is UIElement) ((UIElement)element).AddHandler (PreviewStylusOutOfRangeEvent, handler); else if (element is ContentElement) ((ContentElement)element).AddHandler (PreviewStylusOutOfRangeEvent, handler); else throw new NotSupportedException (); }
public static void RemoveStylusUpHandler (DependencyObject element, StylusEventHandler handler) { if (element == null) throw new ArgumentNullException ("element"); if (handler == null) throw new ArgumentNullException ("handler"); if (element is UIElement) ((UIElement)element).RemoveHandler (StylusUpEvent, handler); else if (element is ContentElement) ((ContentElement)element).RemoveHandler (StylusUpEvent, handler); else throw new NotSupportedException (); }
public static void AddStylusEnterHandler(System.Windows.DependencyObject element, StylusEventHandler handler) { }
public static void AddLostStylusCaptureHandler(System.Windows.DependencyObject element, StylusEventHandler handler) { }
public static void RemovePreviewStylusMoveHandler(System.Windows.DependencyObject element, StylusEventHandler handler) { }
/// <summary> /// Removes a handler for the StylusInRange 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 RemoveStylusInRangeHandler(DependencyObject element, StylusEventHandler handler) { UIElement.RemoveHandler(element, StylusInRangeEvent, handler); }
/// <summary> /// Adds a handler for the GotStylusCapture 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 AddGotStylusCaptureHandler(DependencyObject element, StylusEventHandler handler) { UIElement.AddHandler(element, GotStylusCaptureEvent, handler); }
/// <summary> /// Adds a handler for the PreviewStylusOutOfRange 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 AddPreviewStylusOutOfRangeHandler(DependencyObject element, StylusEventHandler handler) { UIElement.AddHandler(element, PreviewStylusOutOfRangeEvent, handler); }
/// <summary> /// Removes the label if a stroke is erased /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void InkCanvas_StrokeErased(object sender, StylusEventHandler e) { HideAllTooltips(); }
/// <summary> /// Removes a handler for the PreviewStylusUp 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 RemovePreviewStylusUpHandler(DependencyObject element, StylusEventHandler handler) { UIElement.RemoveHandler(element, PreviewStylusUpEvent, 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) { StylusEventHandler handler = (StylusEventHandler)genericHandler; handler(genericTarget, this); }
/// <summary> /// Removes a handler for the PreviewStylusInAirMove 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 RemovePreviewStylusInAirMoveHandler(DependencyObject element, StylusEventHandler handler) { UIElement.RemoveHandler(element, PreviewStylusInAirMoveEvent, handler); }
/// <summary> /// Adds a handler for the StylusLeave 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 AddStylusLeaveHandler(DependencyObject element, StylusEventHandler handler) { UIElement.AddHandler(element, StylusLeaveEvent, handler); }
public static void RemovePreviewStylusOutOfRangeHandler(DependencyObject element, StylusEventHandler handler) { if (element == null) { throw new ArgumentNullException("element"); } if (handler == null) { throw new ArgumentNullException("handler"); } if (element is UIElement) { ((UIElement)element).RemoveHandler(PreviewStylusOutOfRangeEvent, handler); } else if (element is ContentElement) { ((ContentElement)element).RemoveHandler(PreviewStylusOutOfRangeEvent, handler); } else { throw new NotSupportedException(); } }