AgentStack
SKILL verified MIT Self-run

Avalonia Controls Data Display

skill-linuxdevel-avalonia-skills-data-display · by linuxdevel

Use when working with Avalonia data display controls: TextBlock, Label, ListBox, DataGrid, TreeView, ItemsControl, Carousel, or MarkdownViewer. Covers binding patterns, templates, virtualization, selection modes, and column configuration for Avalonia 12.

No reviews yet
0 installs
9 views
0.0% view→install

Install

$ agentstack add skill-linuxdevel-avalonia-skills-data-display

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Avalonia Controls Data Display? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Avalonia Data Display Controls

Overview

Data display controls render read-only or selectable information. Prefer ItemsControl for simple lists, ListBox when selection is needed, DataGrid for tabular data, and TreeView for hierarchical data.


TextBlock

| Property | Type | Notes | |---|---|---| | Text | string | Plain text content | | FontSize | double | In device-independent pixels | | FontWeight | FontWeight | Normal, Bold, SemiBold, etc. | | FontStyle | FontStyle | Normal, Italic, Oblique | | TextWrapping | TextWrapping | NoWrap, Wrap, WrapWithOverflow | | TextTrimming | TextTrimming | None, CharacterEllipsis, WordEllipsis | | TextDecorations | TextDecorationCollection | Underline, Strikethrough | | LineHeight | double | Line spacing | | MaxLines | int | Clamps number of displayed lines | | Inlines | InlineCollection | Mixed-format inline content |


    Important:
     This is 
    critical
    
    

Label

| Property | Type | Notes | |---|---|---| | Content | object | Text or XAML content | | Target | IInputElement | Associates access key with target control |

Use _ prefix in content to define an access key (Alt+key focuses Target).

> Note: Label adds padding and is a ContentControl. For pure display, prefer TextBlock.


ItemsControl

Base class for all list controls. Use directly when no selection is needed.

| Property | Type | Notes | |---|---|---| | ItemsSource | IEnumerable | Bound collection | | ItemTemplate | DataTemplate | Template for each item | | ItemsPanel | ItemsPanelTemplate | Layout panel (default: StackPanel) | | ItemContainerTheme | ControlTheme | Style for each container |


    
        
            
                
            
        
    
    
    
        
            
        
    

ListBox

Extends ItemsControl with selection. Virtualizes items by default.

| Property | Type | Notes | |---|---|---| | SelectedItem | object | TwoWay by default | | SelectedItems | IList | Multiple selection (requires SelectionMode flag) | | SelectedIndex | int | Zero-based index | | SelectionMode | SelectionMode | Single, Multiple, Toggle, AlwaysSelected | | Scroll | ScrollViewer | Access the internal scroll viewer |


    
        
            
                
                
            
        
    

    
        
            
        
    

DataGrid

Requires separate NuGet package: Avalonia.Controls.DataGrid

Add to App.axaml styles:

Namespace: xmlns:dg="using:Avalonia.Controls"

| Property | Type | Notes | |---|---|---| | ItemsSource | IEnumerable | Bound collection | | AutoGenerateColumns | bool | False for manual columns | | CanUserSortColumns | bool | Click-to-sort | | CanUserResizeColumns | bool | Drag column edges | | CanUserReorderColumns | bool | Drag column headers | | GridLinesVisibility | DataGridGridLinesVisibility | All, Horizontal, Vertical, None | | FrozenColumnCount | int | Columns that don't scroll | | RowBackground | IBrush | Row fill | | AlternatingRowBackground | IBrush | Alternating fill | | SelectedItem | object | TwoWay | | SelectionMode | DataGridSelectionMode | Single, Extended |

Column types:

| Type | Use for | |---|---| | DataGridTextColumn | String/primitive display | | DataGridCheckBoxColumn | Boolean values | | DataGridTemplateColumn | Custom cell content |


    
        
        
        
        
        
            
                
                    
                
            
        
    

> Note: DataGrid column Binding always uses reflection bindings ({Binding ...}), even when the page uses compiled bindings. x:DataType on DataTemplate inside columns is not supported.


TreeView

| Property | Type | Notes | |---|---|---| | ItemsSource | IEnumerable | Root nodes | | ItemTemplate | TreeDataTemplate | Must use TreeDataTemplate for hierarchy | | SelectedItem | object | TwoWay | | AutoScrollToSelectedItem | bool | Scrolls to selection |

TreeDataTemplate has an ItemsSource property that points to each node's children collection.


    
        
            
                
                
            
        
    
public class TreeNodeVm
{
    public string Name { get; set; } = "";
    public string IconData { get; set; } = "";
    public ObservableCollection Children { get; } = new();
}

Carousel

Displays one item at a time with animated transitions. Useful for image galleries, onboarding flows, or wizard steps.

| Property | Type | Notes | |---|---|---| | ItemsSource | IEnumerable | Bound collection | | SelectedIndex | int | TwoWay | | SelectedItem | object | TwoWay | | PageTransition | IPageTransition | Animation between items | | IsVirtualized | bool | Only renders visible item |

Built-in transitions: PageSlide, CrossFade, CompositePageTransition


    
        
    
    
        
            
                
            
        
    

    
    
    

Common Mistakes

| Mistake | Fix | |---|---| | DataGrid not styled / missing | Add Avalonia.Controls.DataGrid NuGet and include Fluent.xaml style | | DataGrid column Binding with x:DataType | Not supported in columns — use reflection {Binding}, not compiled | | TreeView using plain DataTemplate | Use TreeDataTemplate with ItemsSource pointing to children; plain DataTemplate won't expand | | ListBox.SelectedItems always empty | Requires SelectionMode="Multiple" (or Toggle) to populate | | ItemsControl inside ScrollViewer inside StackPanel | StackPanel gives infinite height — items render but ScrollViewer won't scroll. Use Grid row with * height | | Carousel flickering on fast navigation | Set IsVirtualized="True" and use CrossFade instead of PageSlide for smoother transitions | | TextBlock not trimming | TextTrimming requires a MaxWidth constraint or a parent that constrains width |

Source & license

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

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

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.