-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slider: minimum can't be set greater than zero #245
Comments
Thanks. Thought this one was handled and forgot about the roadmap. |
Ok, so not as easy as I thought after all. :) A good way to ensure we're correctly updating the slider, I think, is to enforce setting Minimum and Maximum at the same time instead of separately. View.Slider(
minimumMaximum=(10.0, 25.0)
) |
@TimLariviere This breaks backwards compatibility though; doesn't it? Perhaps it is worth it though. (I can't speak to the correct solution though as I haven't dug into the sources :) ) |
Do we also have to factor |
Yes, this breaks backwards compatibility. Given we've not yet reached v1.0, I think it's ok. As far as I tested it, |
OK, sounds good then! |
The proposed solution is good but I think it needs to be MinimumValueMaximum not just MinimumMaximum. The bug can also be fixed in Xamarin.Forms xamarin/Xamarin.Forms#1943 (comment) |
This bug is acknowledged in ROADMAP.md, but it didn't yet have an issue, so I thought I'd make it trackable here.
It's currently impossible to create a
View.Slider
with a minimum value greater than zero because minimum gets set before maximum, causing XF to consider minimum invalid (see: https://forums.xamarin.com/discussion/19131/invalid-value-for-slider-minimum). A fix to this would make sure the minimum gets set after the maximum iff minimum > maximum.You can work around this for now by using
minimum = 0
and doing the math to adjust the value forvalue
and insidevalueChanged
.For searchability, here is the exception you get when you try using a positive value for minimum:
The text was updated successfully, but these errors were encountered: