Controls Reference

PlusUi provides a comprehensive set of UI controls for building cross-platform applications.


All Controls

Text Controls

  • Label - Display static or dynamic text
  • Entry - Single-line text input
  • Link - Clickable hyperlink

Input Controls

Layout Controls

Display Controls

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)

Table of contents


Back to top

PlusUi is licensed under the MIT License.