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
1735
Binding MinValue/MaxValue in XamNumericSlider
posted

Hi,

I have an issue using databinding with the MinValue/MaxValue of the XamNumericSlider. In my actual application I try to bind the MaxValue property while setting the MinValue to 0. However, the MinValue ends up being set to -1. I guessed that this had something to do with the MaxValue being bound to the value 0 (i.e. the same as the MinValue) and tried to use a binding for the MinValue as well. However, even though MaxValue is set correctly by the binding to whatever positive number, the slider's MinValue is stuck at -1.

I have attached a sample application that show the issue. The application sets the MinValue/MaxValue based on databinding, with both source values set to 0. This results in the actual slider MinValue being set to -1. If I then use the 'Increment MaxValue by 1' button to set the MaxValue to a value of at least 1, and then use the 'Set MinValue to MaxValue - 1' button to try to set the MinValue, the slider's MinValue is stuck at -1.

The sample application has a '#define MAX_IT_WORK' directive that can be used to set the initial source MaxValue to 1 rather than 0. In this case, the sample application works as expected, i.e. the MinValue is updated correctly using the button. However, my actual application does still seem to have the issue if I make sure that the MaxValue source is always bigger than 0.

How can I get my bindings to work?

Regards,
Leif

XamSliderSample.zip
Parents Reply Children
No Data