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
2092
Adding Thumbs to XamNumericRangeSlider
posted

I have an issue when adding thumbs to XamNumericRangeSlider. I'm adding them in code-behind and clearing all thumbs before I add the new ones. I also add them in order from highest value to lowest. I have three thumbs. My slider has min-max values of -20 and 20.

If I add thumb values of 0, 1 and 12, it works fine but if I use values like -3, -1 and 12, it doesn't work. The -3 and -1 values become the same which is probably because of the interaction mode being set to lock. This seems to be some kind of a bug in slider since the behavior changes when the values change. 

I have attached a sample project where you can reproduce this. I'm using SL5 and 11.2 version of your controls. Thanks in advance!

SliderThumbAddingSample.zip
Parents
  • 435
    Verified Answer
    posted

    Hi,

    What you are actually seeing is because of the way the binding works in SL. What is actually happening is the Thumbs are being added to the collection with the default value of 0, and then the values are being bound in and adjusted. The behavior is actually the same in both cases; please allow me to explain why.

    Values 0, 1, 12:

    ·         The first thumb is dropped onto the slider with a value of 0.  Now the binding occurs and moves the thumb to 12.  No other thumbs, no interactions occur.

    ·         The second thumb is dropped at 0, and then moved to 1.  Again it can move without restriction and does.

    ·         The last thumb is dropped at 0, and then the value 0 is bound in, nothing happens.

    Values -3, -1, 12:

    ·         The first thumb is dropped on the slider at 0.  The value is bound in and it moves to 12 without issue.

    ·         The second thumb is dropped at 0, and then moved to -1. 

    ·         The last thumb is dropped at 0, and then bound to -3.  When it attempts to move it finds a locked thumb at -1 and stops.

    I hope that help,

    Thanks,

    Rich

Reply Children