Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3160
Need to bind slider thumb value to xamnumericeditor.
posted

I have been tasked with creating a range selector control that is basically a slider control with a textbox on each end so the user can manually type in values.

In a nutshell, I bound the value property of the thumbs to the text property of the textboxes. That worked well but since there is no way to set the increment of the slider (please fix this!!!) we were seeing a lot of unneeded decimal places in the textbox. 

To fix that I removed the textbox and put in a xamnumericeditor so I cound use a mask to at least format the value returned by the slider.  Unfortunately, binding to the text or value property of the xamnumericeditor causes the slider to be updated with each keystroke (vs the WPF textbox which causes the binding to update only after the textbox loses the focust). 

To fix the binding issue, I set the binding to oneway and handled the lost focus event of the xamnumericedotr.  Unfortuantely, setting the value of the xamnumericedit in the lostfocus event causes the binding to break.

So I'm out of things to try now.  The goal is to be able to move the slider thumb and have the textbox update with the value, or to be able to type a value into the textbox and move the slider thumb.

 

 

 

 

SliderTest.zip
Parents Reply Children
No Data