Controls Reference
PlusUi provides a comprehensive set of UI controls for building cross-platform applications.
All Controls
Text Controls
Input Controls
- Button - Clickable button with text/icon
- Checkbox - Binary on/off selection
- RadioButton - Mutually exclusive selection
- Toggle - On/off switch
- Slider - Value range selection
- ComboBox - Dropdown selection
- DatePicker - Date selection with calendar
- TimePicker - Time selection
Layout Controls
- VStack - Vertical stack layout
- HStack - Horizontal stack layout
- Grid - Row/column grid layout
- UniformGrid - Equal-sized cell grid
- ScrollView - Scrollable container
- Border - Container with border stroke
- TabControl - Tabbed content container
- Toolbar - Application toolbar
Display Controls
- Image - Display images (static, animated, SVG)
- ProgressBar - Determinate progress indicator
- ActivityIndicator - Loading spinner
- Separator - Visual divider line
- Solid - Colored rectangle/spacer
Data Controls
- ItemsList - Virtualized list for large datasets
- DataGrid - Tabular data with columns
- TreeView - Hierarchical tree structure
Other Controls
- UserControl - Creating custom reusable components
- Gestures - Tap, DoubleTap, LongPress, Swipe, Pinch
- Popups - Modal dialogs and overlays
Common Properties
All controls inherit from UiElement and share these common properties:
Sizing
.SetDesiredSize(new Size(200, 100)) // Fixed size
.SetDesiredWidth(200) // Fixed width only
.SetDesiredHeight(100) // Fixed height only
Alignment
.SetHorizontalAlignment(HorizontalAlignment.Center)
.SetVerticalAlignment(VerticalAlignment.Center)
// Values: Left/Top, Center, Right/Bottom, Stretch (default)
Margins
.SetMargin(new Margin(10)) // All sides
.SetMargin(new Margin(10, 20)) // Horizontal, Vertical
.SetMargin(new Margin(10, 20, 30, 40)) // Left, Top, Right, Bottom
Background
.SetBackground(new SolidColorBackground(Colors.Blue))
.SetBackground(new LinearGradient(Colors.Blue, Colors.Purple, 45))
Corner Radius
.SetCornerRadius(8)
Visibility
.SetIsVisible(false)
.BindIsVisible(nameof(vm.ShowItem), () => vm.ShowItem)
Tooltips
.SetTooltip("Helpful text")
.SetTooltipPlacement(TooltipPlacement.Top)
.SetTooltipShowDelay(500)
Fluent API Pattern
All PlusUi controls use a fluent API pattern:
new Button()
.SetText("Click Me")
.SetTextSize(16)
.SetTextColor(Colors.White)
.SetBackground(new SolidColorBackground(Colors.Blue))
.SetPadding(new Margin(20, 10))
.SetCornerRadius(8)
.SetCommand(vm.ClickCommand)
Data Binding Pattern
Every Set* method has a corresponding Bind* method:
// Static value
.SetText("Hello")
// Bound value (updates when property changes)
.BindText(nameof(vm.Greeting), () => vm.Greeting)
// Two-way binding (for input controls)
.BindText(nameof(vm.Name), () => vm.Name, value => vm.Name = value)
Accessibility
Controls support accessibility features:
.SetAccessibilityLabel("Submit button")
.SetAccessibilityHint("Double-tap to submit the form")
.SetTabIndex(1)
.SetTabStop(true)