Пример #1
0
        public ViewportPanel()
        {
            DataContext ??= new ViewportPanelModel();
            Model.PropertyChanged += _Model_PropertyChanged;

            InitializeComponent();
            OverlayContentPresenter.SetBinding(ContentPresenter.ContentProperty, BindingHelper.Create(this, nameof(OverlayContent), BindingMode.OneWay));

            MouseHorizontalWheelEnabler.AddMouseHorizontalWheelHandler(this, OnMouseHorizontalWheel);

            _ViewportControllerChanged();
        }
Пример #2
0
        private static void EnableHorizontalWheelSupportChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var ctl = d as ZoomScrollViewer;

            if ((bool)e.NewValue == false)
            {
                {
                    MouseHorizontalWheelEnabler.RemoveMouseHorizontalWheelHandler(ctl, ctl.OnMouseHorizontalWheel);
                }
            }
            else
            {
                {
                    MouseHorizontalWheelEnabler.AddMouseHorizontalWheelHandler(ctl, ctl.OnMouseHorizontalWheel);
                }
            }
        }