For each .NET Property defined on an Avalonia Control there is a corresponding Attribute. Most of them are Property Attributes, but not all of them.
Button.content "button text"
Events are just like other attributes. You can easily recognize them by their prefix. Events are named like this
Button.onClick (fun args -> // do something )
TextBox.onKeyDown (fun args -> // do something )
TextBox.onKeyUp (fun args -> // do something )
ListBox.onSelectionChanged (fun args -> // do something )
Attached Attributes are used like Events and normal Properties.
⚠ Currently not all attached properties are supported / declared. This is currently in process, feel free to create an issue if something is missing
Content Properties are attributes containing either a single View or a list of Views. They are often named
viewItems, … you get it.
Here are some examples.
// single view content
// takes 'View'
TextBlock.text "some text"
// content view list
// takes 'View list'
Last modified 1mo ago