You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2024. It is now read-only.
Currently Switch only has "Toggled" event, but that is also triggered by bindings or setting it programmatically. It would be nice if I can trigger a command when the user actually taps/clicks the switch.
API Changes
Add a "Clicked" event that is triggered when the user interacts with the Switch.
Intended Use Case
I have an example from an application I am currently working on:
My expectation was that I can simply bind the switch to a model and react on the "Toggled" event to show a message when the user makes a change. But it's triggered just by the user scrolling through the list of switches because of the binding. Having a "Clicked" event would let me do just that.
Thanks for this suggestion! As Xamarin.Forms is now in maintenance mode, this will not happen anymore for Xamarin.Forms. We're only adding bugfixes and stability fixes.
If this is still important to you, make sure to check the .NET MAUI repo and see if it's already on the roadmap. If not, feel free to open a discussion to discuss a change first or open an issue with a detailed feature request. Thanks!
Summary
Currently Switch only has "Toggled" event, but that is also triggered by bindings or setting it programmatically. It would be nice if I can trigger a command when the user actually taps/clicks the switch.
API Changes
Add a "Clicked" event that is triggered when the user interacts with the Switch.
Intended Use Case
I have an example from an application I am currently working on:
My expectation was that I can simply bind the switch to a model and react on the "Toggled" event to show a message when the user makes a change. But it's triggered just by the user scrolling through the list of switches because of the binding. Having a "Clicked" event would let me do just that.
Here is a SO thread about the same problem and a rather ugly workaround, so it doesn't look like I'm the only one who would like to see something similar: https://stackoverflow.com/questions/32975894/xamarin-forms-switch-sends-toggled-event-when-value-is-updated
The text was updated successfully, but these errors were encountered: