I’m trying to create a toggle button based on some of the example code as below. This works in terms of user interaction, but I want to extend this to manage a property representing the On/Off state.
Finally, I’d like to be able to detect the end of the swipe (or toggle) by the user and update the On property accordingly. But I can’t figure out how to detect this event and bind it to the On property.
Would you be able to point me in the right direction?
I want to create a Switch component that I can parameterise with an Observable on/off object (called “on”).
I also want the “on” object to update when the Switch is switched.
Below I have commented out the bits that I added to try to bind to “on”. The user interaction works fine (swipe, click etc) but I’m struggling with binding to “on”.
Not to go into details on ux:Property and two-way data-binding, we actually have an example and another example for custom switches.
The idea is to use the ToggleControl base class, which allows you to data-bind to its Value property directly. The rest is handled nicely with swipe gestures, clicks etc. - everything you’d expect.
All the links to the examples in this forum are not working because are pointing to the old web site www.fusetools.com. The new FuseTools web site is www.fuseopen.com.