It's similar to a checkbox list (or radio buttons list if MultiSelect is set to True). This component is also internally used by ItemPicker which effectively shows an OptionsList in a pop-up.
To use this component, install the Zebble.OptionList nuget package.
It's open source and available on GitHub. Also we welcome any contributions to enhace it.
In Markup (.zbl file):
public override async Task OnInitializing()
{
Items = GetSource().ToList();
await base.OnInitializing();
await InitializeComponents();
}
IEnumerable<Contact> GetSource() => Database.GetList<Contact>();
You can set the DataSource property (either in markup or C#) to populate the options list. The data source can be any IEnumerable object.
Markup
C# code-behind:
{
....
}
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 Checkbox 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
You can see some information about Margin & Padding in Zebble here: http://zebble.net/docs/margin-padding
This property gives you the value of selected item. If MultiSelect property is set to true, the content of Value property is a Enumerable value.
In the event of changing selected item in an options list by user, you can handle it using the following code: