示例#1
0
        private static void CanExecuteEventHandler_IfHasContent(object sender, CanExecuteRoutedEventArgs e)
        {
            ZoomBoxPanel panel = sender as ZoomBoxPanel;

            e.CanExecute = (panel != null) && (panel.Children.Count > 0);
            e.Handled    = true;
        }
示例#2
0
        private static void PropertyChanged_Zoom(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ZoomBoxPanel panel = d as ZoomBoxPanel;

            if (panel != null)
            {
                panel.process_PropertyChanged_Zoom(e);
            }
        }
示例#3
0
        private static void PropertyChanged_AMode(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ZoomBoxPanel panel = d as ZoomBoxPanel;

            if (panel != null)
            {
                panel.RaiseModeChangeEvent();
            }
        }
示例#4
0
        public static void ExecutedEventHandler_RotateReverse(object sender, ExecutedRoutedEventArgs e)
        {
            ZoomBoxPanel panel = sender as ZoomBoxPanel;

            if (panel != null)
            {
                panel.process_RotateHomeReverse(false);
            }
        }
示例#5
0
        public static void ExecutedEventHandler_IncreaseZoom(object sender, ExecutedRoutedEventArgs e)
        {
            ZoomBoxPanel panel = sender as ZoomBoxPanel;

            if (panel != null)
            {
                panel.process_ZoomCommand(true);
            }
        }
示例#6
0
        private static object CoerceMinZoomTick(DependencyObject d, object value)
        {
            double       num   = (double)value;
            ZoomBoxPanel panel = d as ZoomBoxPanel;

            if ((panel != null) && (num >= panel.MaxZoomTick))
            {
                panel.MaxZoomTick = num + 1.0;
            }
            return(num);
        }
示例#7
0
        public static void ExecutedEventHandler_RotateCounterclockwise(object sender, ExecutedRoutedEventArgs e)
        {
            ZoomBoxPanel panel     = sender as ZoomBoxPanel;
            double?      angle     = null;
            string       parameter = e.Parameter as string;

            if ((parameter != null) && (parameter.Length > 0))
            {
                angle = new double?(double.Parse(parameter));
            }
            if (panel != null)
            {
                panel.process_RotateCommand(false, angle);
            }
        }
示例#8
0
        private static object CoerceZoomTick(DependencyObject d, object value)
        {
            double       minZoomTick = (double)value;
            ZoomBoxPanel panel       = d as ZoomBoxPanel;

            if (panel != null)
            {
                if (minZoomTick > panel.MaxZoomTick)
                {
                    return(panel.MaxZoomTick);
                }
                if (minZoomTick < panel.MinZoomTick)
                {
                    minZoomTick = panel.MinZoomTick;
                }
            }
            return(minZoomTick);
        }
示例#9
0
        private static object CoerceMaxZoom(DependencyObject d, object value)
        {
            double       num   = (double)value;
            ZoomBoxPanel panel = d as ZoomBoxPanel;

            if (panel != null)
            {
                if (num < panel.MinZoom)
                {
                    panel.MinZoom = num;
                }
                if (panel.Zoom > num)
                {
                    panel.Zoom = num;
                }
            }
            return(num);
        }