Samples
Avalonia has tons of great samples to help you get started!
Model-View-ViewModel (MVVM)
Use the MVVM pattern to receive and process text input by the user.
Convert a date to a string value, and thereby calculate the age of a person.
Incorporate a converter inside your binding to calculate a new value for the View.
How to invoke methods in your ViewModel from your user interface using commands.
Validate properties and display an error message if the values are invalid.
Show dialogs using ReactiveUI interactions.
Create a dialog manager service that helps you show dialogs in your app.
Data templates
Use DataTemplates to control how your data is displayed.
Create an advanced DataTemplate in code with a FuncDataTemplate.
Implement IDataTemplate in your own class to have full control over your DataTemplates.
Styles and drawing
Customize the style of a button by creating reusable styles.
Create lists of data using bindings and the ListBox control.
Use native menus in your Avalonia app on macOS and Linux.
Build a custom splash screen that loads before your MainWindow.
Create a custom rendered control that interacts with the mouse to form a simple paint application.
See how to load images via XAML, bindings and from the internet.
Use custom fonts, such as Google fonts, within your application.
A sample 2D game in Avalonia created without writing any rendering code.
Custom controls
Create a rating control for users to vote by clicking one of several stars.
Create a custom control that overrides OnRender to use more advanced rendering instead.
Testing
Test your app without a visible graphic user interface using Avalonia's headless platform with XUnit.
Test your app without a visible graphic user interface using Avalonia's headless platform with NUnit.
Automated tests for UI interactions, such as button clicks, text input, and screen navigation.
Other
Interact with the device's clipboard to copy and paste text.
Implement dragging and dropping in an Avalonia app.
Using native 'Save as' and 'Open file' dialogs.
Using native 'Save as' and 'Open file' dialogs with inversion of control (IoC).
An example of how to localize an Avalonia app.
Change the contents of your UI using a view locator.
Set up your app to build with native ahead-of-time (AOT).
Have questions or feedback? Join the conversation below.