MaterialSwitch
November 10, 2023 ยท View on GitHub
Switches toggle the state of a single item on or off.
View Material Design documentation
Screenshot
Example
<material3:MaterialSwitch
Text="Bluetooth *"
IsToggled="False"
TextColor="#0d1a26"
SupportingTextColor="Red"
SupportingText="Bluetooth is required"/>
Documentation
Property BackgroundOnUnselectedColor:
This property is to set the background color when the switch toggled is false.
Property DisabledBackgroundOnUnselectedColor:
This property is to set the disabled background color when the switch toggled is false.
Property BackgroundOnSelectedColor:
This property is to set the background color when the switch toggled is true.
Property DisabledBackgroundOnSelectedColor:
This property is to set the disabled background color when the switch toggled is true.
Property BorderWidth:
This property is to set the border width. Default value is 2.
Property BorderOnUnselectedColor:
This property is to set the border color when the switch toggled is false.
Property DisabledBorderOnUnselectedColor:
This property is to set the disabled border color when the switch toggled is false.
Property BorderOnSelectedColor:
This property is to set the border color when the switch toggled is true.
Property DisabledBorderOnSelectedColor:
This property is to set the disabled border color when the switch toggled is true.
Property IsToggled:
This property is to set if the control is toggled or not. By default is False.
Property ToggledCommand:
This property is to set a command when the switch is toggled.
Property ThumbUnselectedColor:
This property is to set the thumb color when the switch toggled is false.
Property DisabledThumbUnselectedColor:
This property is to set the disabled thumb color when the switch toggled is false.
Property ThumbSelectedColor:
This property is to set the thumb color when the switch toggled is true.
Property DisabledThumbSelectedColor:
This property is to set the disabled thumb color when the switch toggled is true.
Property SelectedIcon:
This property is to set the thumb icon when the switch toggled is true.
Property CustomSelectedIcon:
This property is to set the thumb icon (SVG) when the switch toggled is true.
Property UnselectedIcon:
This property is to set the thumb icon when the switch toggled is false. To show this icon, you must set SelectedIcon
Property CustomUnselectedIcon:
This property is to set the thumb icon (SVG) when the switch toggled is false.
Property Text:
This property is to set the text value.
Property TextColor:
This property is to set the color of the text when the control is enabled.
Property DisabledTextColor:
This property is to set the color of the text when the control is disabled.
Property FontSize:
This property is to set the font size of the text.
Property FontFamily:
This propperty is to set the font family of the text.
Property SupportingText:
This property is to set the error text on the control.
Property SupportingTextColor:
This property is to set the error text color value on the control.
Property SupportingSize:
This property is to set the error text font size value on the control.
Property SupportingFontFamily:
This property is to set the error text font family value on the control.
Property SupportingMargin:
This property is to set the error text margin value on the control.
Property AnimateError:
This property is to set if you can show a ShakeAnimation when there is a error with control.
Property TextSide:
This property is to set the side of the text, it could be: Right or Left. By default is Right.
Property TextVerticalOptions:
This property is to set the VerticalOptions of the text. By default is End.
Property TextHorizontalOptions:
This property is to set the HorizontalOptions of the text. By default is Start.
Property SwitchHorizontalOptions:
This property is to set the HorizonatlOptions of the switch. By default is start.
Property Spacing:
This property is to set the space between switch and text. By default is 10.
Property IsEnabled:
This property is to set if the control is enabled or not. By default is True.