A switch class is a toggle control allowing the user to select a status of ON or OFF.
It is an alternative to checkbox but is more commonly used in mobile apps.
To use this component, install the Zebble.Switch nuget package.
It's open source and available on GitHub. Also we welcome any contributions to enhace it.
Like CheckBox, if you want to control what happens when a user toggles a switch you can use CheckedChanged action.
You can set the value of Switch by changing Checked property. The default value is false.
Stylesheet has a boolean property named Ignored, which is false by default. When set to true it works the same as "display: none" in HTML. It means that the element will not only be invisible, but also it won't occupy space on the screen.
View has a boolean property named Enabled, which is true by default. When set to false the object will not respond to UI gesture events. But it will remain visible. Also, its PseudoCssState will be set to "disabled" which allows you to specify a visual style for it in CSS.
If you set the Enabled property of Switch to false, the user can not change the value of it.
You can see some information about rotation in Zebble here: http://zebble.net/docs/rotation-in-zebble
Sample 1:
Sample 2:
You can see some information about Margin & Padding in Zebble here: http://zebble.net/docs/margin-padding
Style.BoxShadow.Color ="red" Style.BoxShadow.BlurRadius="15" Style.BoxShadow.XOffset="5" Style.BoxShadow.YOffset="5" />
You can use CheckedImage field to set an image for the checked state, like the following:
The main event for a Switch is CheckedChanged. In this method you should define what you want to do when user checks/unchecks the Switch control.