protected override void OnMouseWheel(MouseWheelEventArgs e) { e.Handled = true; Point center = e.GetPosition(cardsView); var mess = new MouseWheelTableZoom(e.Delta,center); Messenger.Default.Send(mess); base.OnMouseWheel(e); }
protected override void OnMouseWheel(MouseWheelEventArgs e) { e.Handled = true; Point center = e.GetPosition(cardsView); var mess = new MouseWheelTableZoom(e.Delta, center); Messenger.Default.Send(mess); base.OnMouseWheel(e); }
internal void OnMouseWheelTableZoom(MouseWheelTableZoom e) { double oldZoom = Zoom; // May be animated // Set the new zoom level if (e.Delta > 0) { Zoom = oldZoom + 0.125; } else if (oldZoom > 0.15) { Zoom = oldZoom - 0.125; } // Adjust the offset to center the zoom on the mouse pointer //double ratio = oldZoom - Zoom; //Offset += new Vector(e.Center.X * ratio, e.Center.Y * ratio); }
internal void OnMouseWheelTableZoom(MouseWheelTableZoom e) { double oldZoom = Zoom; // May be animated // Set the new zoom level if (e.Delta > 0) Zoom = oldZoom + 0.125; else if (oldZoom > 0.15) Zoom = oldZoom - 0.125; // Adjust the offset to center the zoom on the mouse pointer //double ratio = oldZoom - Zoom; //Offset += new Vector(e.Center.X * ratio, e.Center.Y * ratio); }