Skip to content

NumericUpDown rollover behavior #4473

Closed Answered by dknippel
dknippel asked this question in Q&A
Discussion options

You must be logged in to vote

We did find a solution, albeit specific to our particular scenario addressing degrees. Essentially we added the following logic to the backing property to which said NumericUpDown control is bound to:

        private double _rotateX;
        public double RotateX
        {
            get { return _rotateX; }
            set 
            {
                value = (((value + 180d) % 360d) + 360d) % 360d - 180d;
                SetProp<double>(ref _rotateX, value);
            }
        }

Granted, I don't think this is ideal but hopefully it might help someone else out there or perhaps spark an improved solution.

In exchange, could perhaps someone help me with another discussion item #4433

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@dknippel
Comment options

Answer selected by dknippel
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants