Exemplo n.º 1
0
        private static void InputAdapterPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            ZoomCanvas canvas = obj as ZoomCanvas;

            if (canvas == null)
            {
                return;
            }

            IZoomCanvasInputAdapter newAdapter = e.NewValue as IZoomCanvasInputAdapter;
            IZoomCanvasInputAdapter oldAdapter = e.OldValue as IZoomCanvasInputAdapter;

            if (oldAdapter != null)
            {
                oldAdapter.SetState             -= canvas.ChildSetState;
                oldAdapter.ManipulationDelta    -= canvas.ChildManipulationDelta;
                oldAdapter.ManipulationComplete -= canvas.ChildManipulationComplete;
            }

            if (newAdapter != null)
            {
                newAdapter.SetState             += canvas.ChildSetState;
                newAdapter.ManipulationDelta    += canvas.ChildManipulationDelta;
                newAdapter.ManipulationComplete += canvas.ChildManipulationComplete;
            }
        }
Exemplo n.º 2
0
        private static void IsLockedPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            ZoomCanvas canvas = obj as ZoomCanvas;

            if (canvas == null)
            {
                return;
            }

            canvas.UpdateIsLocked();
        }