Exemplo n.º 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;
        }
Exemplo n.º 2
0
        private static void PropertyChanged_Zoom(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ZoomBoxPanel panel = d as ZoomBoxPanel;

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

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

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

            if (panel != null)
            {
                panel.process_ZoomCommand(true);
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }