private void OnAnimationCompleted(object sender, EventArgs e) { staticGraphControl.CurrentGraphCanvas.graphCanvas.SetValue(RenderOptions.BitmapScalingModeProperty, BitmapScalingMode.Fant); //To ensure the scale and offset reach the "end" if (ZoomAndPanAnimationHelper.newScale != double.MinValue) { staticGraphControl.scaleTransform.ScaleX = ZoomAndPanAnimationHelper.newScale; staticGraphControl.scaleTransform.ScaleY = ZoomAndPanAnimationHelper.newScale; } staticScrollViewer.ScrollToHorizontalOffset(ZoomAndPanAnimationHelper.newOffsetX); staticScrollViewer.ScrollToVerticalOffset(ZoomAndPanAnimationHelper.newOffsetY); Slider slider = staticGraphControl.slider; // update the slider value slider.Value = staticGraphControl.scaleTransform.ScaleX; if (mousePosition != new Point(-1, -1)) { SetCursorPos((int)(mousePosition.X * slider.Value - staticScrollViewer.HorizontalOffset), (int)(mousePosition.Y * slider.Value - staticScrollViewer.VerticalOffset)); mousePosition = new Point(-1, -1); } staticGraphControl.SetCursor(currentCursor); this.visualHost.animationOn = false; }
private void OnTopMouseMove(object sender, MouseEventArgs e) { IInfoBubble bubble; graphControl.CurrentGraphCanvas.VisualHost.Controller.GetInfoBubble((uint)this.Tag, out bubble); if (bubble.Collapsed) { graphControl.SetCursor(CursorSet.Index.Expand); } else { graphControl.SetCursor(CursorSet.Index.Condense); } e.Handled = true; }