# Avalonia Controls Input

> Use when working with Avalonia input controls: Button, ToggleButton, RadioButton, CheckBox, TextBox, ComboBox, Slider, Calendar, DatePicker, TimePicker, NumericUpDown, or VirtualKeyboard. Covers key properties, events, binding patterns, and common pitfalls for each control in Avalonia 12.

- **Type:** Skill
- **Install:** `agentstack add skill-linuxdevel-avalonia-skills-input`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [linuxdevel](https://agentstack.voostack.com/s/linuxdevel)
- **Installs:** 0
- **Category:** [Productivity](https://agentstack.voostack.com/c/productivity)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [linuxdevel](https://github.com/linuxdevel)
- **Source:** https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-controls/input

## Install

```sh
agentstack add skill-linuxdevel-avalonia-skills-input
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Avalonia Input Controls

## Overview

Input controls capture user data or trigger actions. All support `IsEnabled`, `IsVisible`, and standard styling.

---

## Button

| Property | Type | Notes |
|---|---|---|
| `Content` | `object` | Any content, including XAML subtrees |
| `Command` | `ICommand` | Bound command; auto-manages `IsEnabled` |
| `CommandParameter` | `object` | Passed to command |
| `IsDefault` | `bool` | Triggers on Enter |
| `IsCancel` | `bool` | Triggers on Escape |
| `ClickMode` | `ClickMode` | `Release` (default), `Press`, `Hover` |

**Events:** `Click`

**Variants:** `RepeatButton` (fires `Click` repeatedly while held), `ToggleButton` (stateful press)

```xml

    
        
        
    

```

---

## CheckBox

| Property | Type | Notes |
|---|---|---|
| `IsChecked` | `bool?` | `null` = indeterminate |
| `IsThreeState` | `bool` | Enables null/indeterminate state |
| `Content` | `object` | Label displayed next to box |

```xml

```

```csharp
// Handle indeterminate in ViewModel
private bool? _allSelected;
public bool? AllSelected
{
    get => _allSelected;
    set => SetProperty(ref _allSelected, value);
}
```

---

## RadioButton

| Property | Type | Notes |
|---|---|---|
| `IsChecked` | `bool` | TwoWay by default |
| `GroupName` | `string` | Groups buttons across panels |
| `Content` | `object` | Label |

```xml

    
    
    

    
    

```

> **Tip:** For enum-based selection, bind each `IsChecked` to a converter comparing the enum value, or use `ItemsControl` with `RadioButton` items.

---

## TextBox

| Property | Type | Notes |
|---|---|---|
| `Text` | `string` | TwoWay by default — do **not** add `Mode=TwoWay` |
| `Watermark` | `string` | Placeholder text |
| `MaxLength` | `int` | 0 = unlimited |
| `AcceptsReturn` | `bool` | Multiline input |
| `TextWrapping` | `TextWrapping` | `NoWrap`, `Wrap`, `WrapWithOverflow` |
| `IsReadOnly` | `bool` | Prevents editing |
| `PasswordChar` | `char` | Masks input (e.g. `•`) |
| `SelectionStart` | `int` | Caret/selection start |
| `SelectionLength` | `int` | Selection length |
| `InnerLeftContent` | `object` | Icon inside left edge |
| `InnerRightContent` | `object` | Icon inside right edge |

**Events:** `TextChanged`, `TextChanging`, `LostFocus`, `KeyDown`

```xml

    
        
    

```

---

## ComboBox

| Property | Type | Notes |
|---|---|---|
| `ItemsSource` | `IEnumerable` | Bound collection |
| `SelectedItem` | `object` | TwoWay by default |
| `SelectedIndex` | `int` | Zero-based |
| `SelectedValue` | `object` | Used with `SelectedValueBinding` |
| `IsEditable` | `bool` | Allows text entry |
| `PlaceholderText` | `string` | Shown when nothing selected |
| `MaxDropDownHeight` | `double` | Limits dropdown height |

```xml

    
        
            
                
                
            
        
    

```

---

## Slider

| Property | Type | Notes |
|---|---|---|
| `Minimum` | `double` | Default: 0 |
| `Maximum` | `double` | Default: 100 |
| `Value` | `double` | TwoWay by default |
| `TickFrequency` | `double` | Interval between ticks |
| `IsSnapToTickEnabled` | `bool` | Snaps value to tick marks |
| `Orientation` | `Orientation` | `Horizontal` (default), `Vertical` |
| `IsDirectionReversed` | `bool` | Inverts direction |
| `TickPlacement` | `TickPlacement` | `None`, `TopLeft`, `BottomRight`, `Outside` |

```xml

```

---

## NumericUpDown

| Property | Type | Notes |
|---|---|---|
| `Value` | `decimal?` | TwoWay by default |
| `Minimum` | `decimal?` | Lower bound |
| `Maximum` | `decimal?` | Upper bound |
| `Increment` | `decimal` | Step per click |
| `FormatString` | `string` | e.g. `"F2"`, `"N0"`, `"C2"` |
| `AllowSpin` | `bool` | Show up/down buttons |
| `ShowButtonSpinner` | `bool` | Toggle spinner visibility |
| `NumberFormat` | `NumberFormatInfo` | Culture-specific formatting |

```xml

```

---

## Calendar

| Property | Type | Notes |
|---|---|---|
| `SelectedDate` | `DateTime?` | Selected date |
| `DisplayMode` | `CalendarMode` | `Month`, `Year`, `Decade` |
| `DisplayDate` | `DateTime` | Currently displayed month |
| `BlackoutDates` | `CalendarBlackoutDatesCollection` | Disabled dates |
| `IsTodayHighlighted` | `bool` | Highlights today |
| `SelectionMode` | `CalendarSelectionMode` | `SingleDate`, `SingleRange`, `MultipleRange`, `None` |

```xml

```

```csharp
calendar.BlackoutDates.Add(new CalendarDateRange(DateTime.Today.AddDays(1), DateTime.Today.AddDays(7)));
```

---

## DatePicker

| Property | Type | Notes |
|---|---|---|
| `SelectedDate` | `DateTimeOffset?` | Note: **not** `DateTime` |
| `DisplayDateStart` | `DateTimeOffset?` | Earliest selectable |
| `DisplayDateEnd` | `DateTimeOffset?` | Latest selectable |
| `Watermark` | `string` | Placeholder |
| `DayFormat` | `string` | Day display format |
| `MonthFormat` | `string` | Month display format |
| `YearFormat` | `string` | Year display format |

```xml

```

```csharp
// Convert DateTimeOffset? to DateTime for use
DateTime? date = picker.SelectedDate?.DateTime;
```

---

## TimePicker

| Property | Type | Notes |
|---|---|---|
| `SelectedTime` | `TimeSpan?` | Selected time value |
| `ClockIdentifier` | `string` | `"12HourClock"` or `"24HourClock"` |
| `MinuteIncrement` | `int` | Snap interval (1–59) |

```xml

```

---

## Common Mistakes

| Mistake | Fix |
|---|---|
| `TextBox Text="{Binding X, Mode=TwoWay}"` | Remove `Mode=TwoWay` — it's the default |
| `ComboBox` with value types, `SelectedItem` not working | Use `SelectedIndex` or ensure proper equality; value types match by value but boxed objects may not |
| All `RadioButton`s in same panel auto-group | Use `GroupName` to separate groups across panels or force cross-panel grouping |
| `DatePicker.SelectedDate` typed as `DateTime` | It's `DateTimeOffset?` — convert with `.DateTime` |
| `NumericUpDown.Value` typed as `double` | It's `decimal?` — use `decimal` in ViewModel |
| `TextBox` binding not updating on every keystroke | Default updates on `LostFocus`; use `UpdateSourceTrigger=PropertyChanged` if needed |
| `PasswordChar` with compiled bindings | No issue, but `Text` binding exposes password in ViewModel — consider `SecureString` patterns |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [linuxdevel](https://github.com/linuxdevel)
- **Source:** [linuxdevel/Avalonia-skills](https://github.com/linuxdevel/Avalonia-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-linuxdevel-avalonia-skills-input
- Seller: https://agentstack.voostack.com/s/linuxdevel
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
