IconToggle
Description
A group of icon buttons of which exactly one is selected at a time, like a segmented control. Each item carries a UIcons glyph, a tooltip and an arbitrary data payload, which is exposed through the typed Selected property.
Usage
API reference
public class IconToggle<T> : IComponent, IBindableComponent<T>, IRoundedStyleA group of icon buttons of which exactly one is selected at a time, like a segmented control.
- Namespace
- Tesserae
- Implements
- IComponent, IBindableComponent<T>, IRoundedStyle
Constructors
| Name | Description |
|---|---|
| IconToggle | Initializes a new instance of this class. |
Properties
| Name | Description |
|---|---|
| Selected | Gets the currently selected data. |
Methods
| Name | Description |
|---|---|
| Render | Renders the component's root HTML element. |
| Select | Selects the item carrying the given data. Values that don't match any item are ignored. |
| AsObservable | Returns the component's state as a(n) observable. |
| SetBoundValue | Programmatically selects an item as part of a two-way binding. Values that don't match any item are ignored. |
| OnChange | Calls the handler whenever the selection changes, but not for the initial selection. |
| Compact | Renders a denser control, for toolbars and other tight spots. |
| Large | Renders a roomier control, for use as a primary, page-level switch. |
| Vertical | Stacks the items top to bottom instead of left to right. |
| Horizontal | Stacks the items left to right, the default. |
| FullWidth | Stretches the control to the width of its container, with every item taking an equal share. |
| Disabled | Configures whether the whole control is disabled. |
public IconToggle<T> Select(T item)Selects the item carrying the given data. Values that don't match any item are ignored.
public IObservable<T> AsObservable()Returns the component's state as a(n) observable.
public void SetBoundValue(T value)Programmatically selects an item as part of a two-way binding. Values that don't match any item are ignored.
public IconToggle<T> OnChange(Action<IconToggle<T>, T> onChange)Calls the handler whenever the selection changes, but not for the initial selection.
public IconToggle<T> Compact()Renders a denser control, for toolbars and other tight spots.
public IconToggle<T> Large()Renders a roomier control, for use as a primary, page-level switch.
public IconToggle<T> Vertical()Stacks the items top to bottom instead of left to right.
public IconToggle<T> Horizontal()Stacks the items left to right, the default.
public IconToggle<T> FullWidth()Stretches the control to the width of its container, with every item taking an equal share.