public void MouseCaptureTestMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { UIElement element; if (MouseCaptureTestCaptureOriginalSource) { element = e.OriginalSource as UIElement; } else { element = e.Source as UIElement; } if (element != null) { if (MouseCaptureTestCaptureSubTree) { element.Screen.CaptureMouse(element, CaptureMode.SubTree); } else { element.CaptureMouse(); } } }
public void MouseCaptureTestMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { UIElement element; if (MouseCaptureTestCaptureOriginalSource) { element = e.OriginalSource as UIElement; } else { element = e.Source as UIElement; } if (element != null) element.ReleaseMouseCapture(); }
/// <summary> /// Invoked when unhandled MouseClick event reaches this element. This method is called before the MouseClick event is fired. /// </summary> /// <param name="e">The event arguments for the event.</param> /// <remarks>This base implementation is empty.</remarks> protected virtual void OnMouseClick(MouseButtonEventArgs e) { }
public void RoutedEventHandler(object sender, MouseButtonEventArgs e) { ServiceRegistration.Get<ILogger>().Debug("RoutedEvent:"); ServiceRegistration.Get<ILogger>().Debug(" Event= {0}", e.RoutedEvent.Name); ServiceRegistration.Get<ILogger>().Debug(" sender= {0}", sender); ServiceRegistration.Get<ILogger>().Debug(" Source= {0}", e.Source); ServiceRegistration.Get<ILogger>().Debug(" OriginalSource= {0}", e.OriginalSource); ServiceRegistration.Get<ILogger>().Debug(" Hit at= {0}", e.GetPosition(sender as UIElement)); }
/// <summary> /// Invoked when unhandled MouseRightButtonUp event reaches this element. This method is called before the MouseRightButtonUp event is fired. /// </summary> /// <param name="e">The event arguments for the event.</param> /// <remarks>This base implementation is empty.</remarks> protected virtual void OnMouseRightButtonUp(MouseButtonEventArgs e) { }
private static void OnMouseClickThunk(object sender, MouseButtonEventArgs e) { var uiElement = sender as UIElement; if (uiElement != null) { uiElement.OnMouseClick(e); } }
private static void OnPreviewMouseRightButtonUpThunk(object sender, MouseButtonEventArgs e) { var uiElement = sender as UIElement; if (uiElement != null) { uiElement.OnPreviewMouseRightButtonUp(e); } }
/// <summary> /// Invoked when unhandled PreviewMouseLeftButtonUp event reaches this element. This method is called before the MouseLeftButtonUp event is fired. /// </summary> /// <param name="e">The event arguments for the event.</param> /// <remarks>This base implementation is empty.</remarks> protected virtual void OnPreviewMouseLeftButtonUp(MouseButtonEventArgs e) { }
private static void OnMouseUpThunk(object sender, MouseButtonEventArgs e) { if (!e.Handled) { var uiElement = sender as UIElement; if (uiElement != null) { uiElement.OnMouseUp(e); } } switch (e.ChangedButton) { case MouseButton.Left: ReRaiseEventAs(sender as UIElement, e, MouseLeftButtonUpEvent); break; case MouseButton.Right: ReRaiseEventAs(sender as UIElement, e, MouseRightButtonUpEvent); break; } }
/// <summary> /// Invoked when unhandled PreviewMouseRightButtonDown event reaches this element. This method is called before the MouseRightButtonDown event is fired. /// </summary> /// <param name="e">The event arguments for the event.</param> /// <remarks>This base implementation is empty.</remarks> protected virtual void OnPreviewMouseRightButtonDown(MouseButtonEventArgs e) { }
/// <summary> /// Invoked when unhandled MouseLeftButtonDown event reaches this element. This method is called before the MouseLeftButtonDown event is fired. /// </summary> /// <param name="e">The event arguments for the event.</param> /// <remarks>This base implementation is empty.</remarks> protected virtual void OnMouseLeftButtonDown(MouseButtonEventArgs e) { }