Exemplo n.º 1
0
        private void Element_MouseWheel(object sender, MouseWheelEventArgs e)
        {
            var magnifier = MagnifierManager.GetMagnifier(_element) as Magnifier;

            if ((magnifier != null) && magnifier.IsUsingZoomOnMouseWheel)
            {
                if (e.Delta < 0)
                {
                    var newValue = magnifier.ZoomFactor + magnifier.ZoomFactorOnMouseWheel;
#if VS2008
                    magnifier.ZoomFactor = newValue;
#else
                    magnifier.SetCurrentValue(Magnifier.ZoomFactorProperty, newValue);
#endif
                }
                else if (e.Delta > 0)
                {
                    var newValue = (magnifier.ZoomFactor >= magnifier.ZoomFactorOnMouseWheel) ? magnifier.ZoomFactor - magnifier.ZoomFactorOnMouseWheel : 0d;
#if VS2008
                    magnifier.ZoomFactor = newValue;
#else
                    magnifier.SetCurrentValue(Magnifier.ZoomFactorProperty, newValue);
#endif
                }
                _adorner.UpdateViewBox();
            }
        }
Exemplo n.º 2
0
        private void Element_MouseLeave(object sender, MouseEventArgs e)
        {
            var magnifier = MagnifierManager.GetMagnifier(_element) as Magnifier;

            if ((magnifier != null) && magnifier.IsFrozen)
            {
                return;
            }

            HideAdorner();
        }