コード例 #1
0
        public override void Execute(object parameter)
        {
            MouseWheelEventArgs wheelEvent = parameter as MouseWheelEventArgs;

            MouseWheelVO vo = new MouseWheelVO
            {
                Delta          = wheelEvent.Delta,
                OriginalSource = wheelEvent.OriginalSource,
                Sender         = wheelEvent.Source
            };

            SignalManager.Get <MouseWheelSignal>().Dispatch(vo);
        }
コード例 #2
0
        private void OnMouseWheel(MouseWheelVO vo)
        {
            if (DataContext is TileSetViewModel viewModel)
            {
                if (!viewModel.IsActive)
                {
                    return;
                }
            }

            const double ScaleRate = 1.1;

            if (vo.Delta > 0)
            {
                scaleCanvas.ScaleX *= ScaleRate;
                scaleCanvas.ScaleY *= ScaleRate;
            }
            else
            {
                scaleCanvas.ScaleX /= ScaleRate;
                scaleCanvas.ScaleY /= ScaleRate;
            }
        }