Ejemplo n.º 1
0
        private static void CanExecuteEventHandler_IfCanDecreaseZoom(Object sender, CanExecuteRoutedEventArgs e)
        {
            ImageZoomBoxPanel z = sender as ImageZoomBoxPanel;

            e.CanExecute = ((z != null) && (z.CanDecreaseZoom));
            e.Handled    = true;
        }
Ejemplo n.º 2
0
        private static void CanExecuteEventHandler_IfHasContent(Object sender, CanExecuteRoutedEventArgs e)
        {
            ImageZoomBoxPanel z = sender as ImageZoomBoxPanel;

            e.CanExecute = ((z != null) && (z.Children.Count > 0));
            e.Handled    = true;
        }
Ejemplo n.º 3
0
        private static void PropertyChanged_Zoom(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ImageZoomBoxPanel z = d as ImageZoomBoxPanel;

            if (z != null)
            {
                z.process_PropertyChanged_Zoom(e);
            }
        }
Ejemplo n.º 4
0
        private static void PropertyChanged_AMode(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ImageZoomBoxPanel z = d as ImageZoomBoxPanel;

            if (z != null)
            {
                z.NotifyPropertyChanged();
            }
        }
Ejemplo n.º 5
0
        public static void ExecutedEventHandler_RotateReverse(Object sender, ExecutedRoutedEventArgs e)
        {
            ImageZoomBoxPanel z = sender as ImageZoomBoxPanel;

            if (z != null)
            {
                z.process_RotateHomeReverse(false);
            }
        }
Ejemplo n.º 6
0
        public static void ExecutedEventHandler_DecreaseZoom(Object sender, ExecutedRoutedEventArgs e)
        {
            ImageZoomBoxPanel z = sender as ImageZoomBoxPanel;

            if (z != null)
            {
                z.process_ZoomCommand(false);
            }
        }
Ejemplo n.º 7
0
        private static object CoerceMaxZoomTick(DependencyObject d, object value)
        {
            double            dv = (double)value;
            ImageZoomBoxPanel z  = d as ImageZoomBoxPanel;

            if (z != null)
            {
                if (dv <= z.MinZoomTick)
                {
                    z.MinZoomTick = dv - 1;
                }
            }
            return(dv);
        }
Ejemplo n.º 8
0
        public static void ExecutedEventHandler_RotateCounterclockwise(Object sender, ExecutedRoutedEventArgs e)
        {
            ImageZoomBoxPanel z     = sender as ImageZoomBoxPanel;
            double?           param = null;
            string            p     = e.Parameter as string;

            if ((p != null) && (p.Length > 0))
            {
                param = Double.Parse(p);
            }
            if (z != null)
            {
                z.process_RotateCommand(false, param);
            }
        }
Ejemplo n.º 9
0
        private static object CoerceMaxZoom(DependencyObject d, object value)
        {
            double            dv = (double)value;
            ImageZoomBoxPanel z  = d as ImageZoomBoxPanel;

            if (z != null)
            {
                if (dv < z.MinZoom)
                {
                    z.MinZoom = dv;
                }
                if (z.Zoom > dv)
                {
                    z.Zoom = dv;
                }
            }
            return(dv);
        }
Ejemplo n.º 10
0
        private static object CoerceZoom(DependencyObject d, object value)
        {
            double            dv = (double)value;
            ImageZoomBoxPanel z  = d as ImageZoomBoxPanel;

            if (z != null)
            {
                if (dv > z.MaxZoom)
                {
                    dv = z.MaxZoom;
                }
                else if (dv < z.MinZoom)
                {
                    dv = z.MinZoom;
                }
            }
            return(dv);
        }