-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Implement ValueChanged for slider #10080
Comments
You just subscribe on PropertyChanged and check for value property. But this event does make sense anyway for consistency with our couple of new events added recently, i.e. TextChanged. |
I definitely like adding support for the older Event pattern. It helps a lot with migrating code. Events also CAN in several instances give more information than a property changed notification. |
Is this the correct way of doing this until implemented?
|
In Avalonia, you can just listen to PropertyChanged which is very handy. But the way you have written will also work. So test both and decide what suits your situation best. |
As a new user to Avalonia I found it very confusing that there was no ValueChanged event for sliders when they exist for other controls. |
@squidink7 I opened #11362 to close this. Please take a look if you can. |
Looks good to me! Everything seems well with that PR, and in the case something goes wrong this can be reopened if need be, but otherwise this issue can be closed! Thanks for your work! |
Is your feature request related to a problem? Please describe.
Currently there is no (easy) way to react to a sliders value changing. I attempted to subscribe to the slider's thumb's DragCompleted event, but due to #4210 even that doesn't work.
Describe the solution you'd like
A ValueChanged event that gets triggered when a slider moves, similar to NumericUpDown's ValueChanged event (or WPF's slider)
Describe alternatives you've considered
Fixing #4210 would also allow this behavior, although is a bit more cumbersome.
The text was updated successfully, but these errors were encountered: