Пример #1
0
        static Zoombox()
        {
            ClipToBoundsProperty.OverrideMetadata(
                typeof(Zoombox),
                new PropertyMetadata(
                    true,
                    ClipToBoundsProperty.GetMetadata(typeof(Decorator)).PropertyChangedCallback));
            CommandManager.RegisterClassCommandBinding(
                typeof(Zoombox),
                new CommandBinding(
                    NavigationCommands.IncreaseZoom,
                    OnIncreaseZoom,
                    OnCanIncreaseZoom));

            CommandManager.RegisterClassCommandBinding(
                typeof(Zoombox),
                new CommandBinding(
                    ZoomCommands.Increase,
                    OnIncreaseZoom,
                    OnCanIncreaseZoom));

            CommandManager.RegisterClassCommandBinding(
                typeof(Zoombox),
                new CommandBinding(
                    NavigationCommands.DecreaseZoom,
                    OnDecreaseZoom,
                    OnCanDecreaseZoom));

            CommandManager.RegisterClassCommandBinding(
                typeof(Zoombox),
                new CommandBinding(
                    ZoomCommands.Decrease,
                    OnDecreaseZoom,
                    OnCanDecreaseZoom));

            CommandManager.RegisterClassCommandBinding(
                typeof(Zoombox),
                new CommandBinding(
                    ZoomCommands.None,
                    OnZoomNone,
                    OnCanZoomNone));

            CommandManager.RegisterClassCommandBinding(
                typeof(Zoombox),
                new CommandBinding(
                    ZoomCommands.Uniform,
                    OnZoomUniform,
                    OnCanZoomUniform));

            CommandManager.RegisterClassCommandBinding(
                typeof(Zoombox),
                new CommandBinding(
                    ZoomCommands.UniformToFill,
                    OnZoomUniformToFill,
                    OnCanZoomUniformToFill));
        }