Tritium UI
TritiumSwitch
Bind a boolean to a switch that follows the Tritium accent color.
Key features
- Bind IsToggled two-way.
- Use the active theme accent for the on state.
- Ignore programmatic updates so feedback plays only for a user toggle.
- Opt in to haptic or sound feedback.
- DataForm uses it for bool properties.
Platforms
Android, iOS, Mac Catalyst, and Windows 10 version 19041 and later (.NET 10 MAUI).
Main API
- IsToggled . The on/off value, two-way.
- HapticFeedback . Opt-in haptic feedback for a user toggle; InputSound is the matching sound switch. Both default off.
Basic example
Declare this namespace on the page.
xmlns:editors="clr-namespace:Tritium.Maui.Editors;assembly=Tritium.Maui.Editors"
<editors:TritiumSwitch IsToggled="True" /> Add the package source from your license, then reference the package that includes this control. These packages are not on the public NuGet Gallery.