protected override void OnMouseMove(MouseEventArgs e) { if (this.IsMouseCaptured) { this.IsPressed = this.WithinBounds(e.GetPosition(this)); } }
private bool ProcessRawMouseEvent(RawMouseEventArgs input) { MouseEventArgs e = null; switch (input.Type) { case RawMouseEventType.Move: e = new MouseEventArgs(this, input.Timestamp); e.RoutedEvent = UIElement.MouseMoveEvent; break; case RawMouseEventType.LeftButtonDown: e = new MouseButtonEventArgs(this, input.Timestamp); e.RoutedEvent = UIElement.MouseLeftButtonDownEvent; break; case RawMouseEventType.LeftButtonUp: e = new MouseButtonEventArgs(this, input.Timestamp); e.RoutedEvent = UIElement.MouseLeftButtonUpEvent; break; } if (e != null) { InputManager.Current.ProcessInput(e); return true; } else { return false; } }
protected virtual void OnMouseMove(MouseEventArgs e) { }
private void UpdateUIElementMouseOvers() { IEnumerable<UIElement> current = this.ElementAndAncestors(this.Target); foreach (UIElement ui in current.Except(this.mouseOvers)) { ui.SetValue(UIElement.IsMouseOverProperty, true); this.mouseOvers.Add(ui); MouseEventArgs e = new MouseEventArgs(this, Environment.TickCount); e.RoutedEvent = UIElement.MouseEnterEvent; ui.RaiseEvent(e); } foreach (UIElement ui in this.mouseOvers.Except(current).ToArray()) { ui.SetValue(UIElement.IsMouseOverProperty, false); this.mouseOvers.Remove(ui); MouseEventArgs e = new MouseEventArgs(this, Environment.TickCount); e.RoutedEvent = UIElement.MouseLeaveEvent; ui.RaiseEvent(e); } }
protected virtual void OnMouseEnter(MouseEventArgs e) { }