Avalonia UI
HomeSupportGitHub Repository
Search
⌃K
Links
👋
Welcome
Documentation
⚡
Getting Started
🔄
Data Binding
🎨
Styling
🧰
Controls
📚
Templates
✏
Authoring Controls
🖱
Input
🔑
Animations
📐
Layout
📦
Distribution / Publishing
API Reference
🧾
Namespaces
Guides
🐣
Basics
🤿
Deep dives
👩💻
👩💻 Developer Guides
Tutorials
📋
ToDo List App
📻
Music Store App
🕸️ Running in the Browser
📱
Developing for Mobile
Misc
👪
Community
🖥
WPF Developers Tips
Styling
DataTemplates
HierachicalDataTemplate
UIElement, FrameworkElement and Control
DependencyProperty
Grid
ItemsControl
Tunnelling Events
Class Handlers
PropertyChangedCallback
RenderTransforms and RenderTransformOrigin
📋
Projects that are using Avalonia
❔
FAQ
Powered By GitBook

ItemsControl

In WPF, ItemsControl and derived classes such as ListBox have two separate items properties: Items and ItemsSource. Avalonia however just has a single one: Items which is same as WPF ItemsSource property.

Before

contextMenu.Items.Add(runItem);

After

var list = contextMenu.Items as IList;
list?.Add(runItem);
Previous
Grid
Next
Tunnelling Events
Last modified 14d ago
Export as PDF
Copy link
Edit on GitHub
On this page
Before
After