コード例 #1
0
        public void Pan(object parameter)
        {
            Debug.WriteLine(string.Format("Offset: {0},{1}, Zoom: {2}", _model.CurrentSpace.X, _model.CurrentSpace.Y, _model.CurrentSpace.Zoom));
            var    panType = parameter.ToString();
            double pan     = 10;
            var    pt      = new Point(_model.CurrentSpace.X, _model.CurrentSpace.Y);

            switch (panType)
            {
            case "Left":
                pt.X += pan;
                break;

            case "Right":
                pt.X -= pan;
                break;

            case "Up":
                pt.Y += pan;
                break;

            case "Down":
                pt.Y -= pan;
                break;
            }
            _model.CurrentSpace.X = pt.X;
            _model.CurrentSpace.Y = pt.Y;

            CurrentSpaceViewModel.OnCurrentOffsetChanged(this, new PointEventArgs(pt));
        }