Skip to content

AvaloniaUI/Avalonia.Samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

457 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Avalonia Logo Samples

Welcome to Avalonia.Samples. This is a collection of minimal samples, which should make it easy for everyone to get started with Avalonia. Each sample is focusing on only one aspect of Avalonia.

๐Ÿ—ฏ Get in touch with us

If you have feedback, questions or suggestions, feel free to contact us via:

chat https%3A%2F%2Fimg.shields.io%2Fbadge%2Fgithub discussions blue%3Flogo%3Dgithub?style=flat&label=github&color=darkgreen&link=https%3A%2F%2Fgithub.com%2FAvaloniaUI%2FAvalonia

Or file a new bug-report or feature request in the Issues-section.

๐Ÿ“‚ Organization of the Samples

Every sample can be found in its own subfolder and can run without any reference to another sample. Nevertheless, we have a *.slnx-file which has all projects in one solution, if you are looking for a complete collection of samples.

โ„น๏ธ
We migrated to the newer *.slnx-File format, which should be supported from all major IDEs. If it doesnโ€™t work for you, please use the project-files inside the subdirectories.

You can find the list of samples below. The samples are structured in different categories and difficulties. For better search results, each sample is also tagged with some buzz-words.

In every sample folder you will find a README-file, which describes the sample in detail and, if applicable, has links to further information and documentation.

๐Ÿฃ Difficulties

Each sample is tagged with its difficulty. The degree of difficulty describes how much base-knowledge a user should have.

๐Ÿ”˜ Difficulty Degree of knowledge

๐Ÿฃ

Beginner

A Beginner must not have any knowledge of Avalonia. Nevertheless, some basic knowledge of C#, X(A)ML and your IDE is mandatory.

๐Ÿฅ

Easy

Some very basic knowledge of Avalonia is needed.

๐Ÿ”

Normal

The user is somewhat experienced with Avalonia.

๐Ÿ‰

Hard

These samples are focusing on non-standard tasks, which most users will not need to know.

โœ๏ธ Samples

๐Ÿ’ก MVVM-Samples

Sample Difficulty Buzz-Words

Basic MVVM Sample

๐Ÿฃ Beginner

MVVM, Model-View-ViewModel, ReactiveUI, INotifyPropertyChanged, XAML, Binding

Commands Sample

๐Ÿฃ Beginner

Command, ICommand, CommandParameter, MVVM, ReactiveCommand, async-await

ValueConverter Sample

๐Ÿฅ Easy

Converter, Binding, MultiBinding, IValueConverter, IMultiValueConverter, MVVM, FuncValueConverter

Validation Sample

๐Ÿฅ Easy

MVVM, Data-Validation, Exception, Error, Error-Message, Binding

DesktopIntegration-Samples

Sample Difficulty Buzz-Words

Tray Icon Sample

๐Ÿฃ Beginner

TrayIcon, ReactiveUI, Binding

โœ’๏ธ Drawing-Samples

Sample Difficulty Buzz-Words

BattleCity Game Sample

๐Ÿ” Normal

Game, Canvas, Game Loop, MVVM

Rect Painter Sample

๐Ÿ” Normal

Graphics, MVVM

๐ŸŽž๏ธ DataTemplate-Samples

Sample Difficulty Buzz-Words

Basic DataTemplate Sample

๐Ÿ” Normal

DataTemplate, ToString, StringFormat, MVVM, ItemTemplate, ContentTemplate

FuncDataTemplate Sample

๐Ÿ” Normal

FuncDataTemplate, DataTemplate, C#, Binding from code

Implementing IDataTemplate Sample

๐Ÿ” Normal

IDataTemplate, DataTemplate, DataTemplateSelector

๐Ÿ—บ๏ธ Routing / Navigation-Samples

Sample Difficulty Buzz-Words

Basic ViewLocator Sample

๐Ÿ” Normal

ViewLocator, Routing, Wizard, Navigation, Page, MVVM

๐Ÿ› ๏ธ Custom Controls Samples

Sample Difficulty Buzz-Words

RatingControl Sample

๐Ÿ” Normal

Control, TemplatedControl, custom Control, reusable Control, AvaloniaProperty, StyledProperty, DirectProperty, ReadonlyProperty, Style, ControlTheme

SnowflakesControl Sample

๐Ÿ” Normal

Custom Control, Render, Hit-Testing, Custom Animations

โšก View Interaction Samples

Sample Difficulty Buzz-Words

Mvvm Dialog Sample

๐Ÿ” Normal

MVVM, Dialog, FileDialogs, TopLevel, Clipboard

Dialog Manager Sample

๐Ÿ” Normal

MVVM, Dialog, FileDialogs, TopLevel, Clipboard, DialogManager, CommunityToolkit.Mvvm

๐Ÿงช๏ธ Automated UI Testing

Sample Difficulty Buzz-Words

Testing with Headless XUnit

๐Ÿ” Normal

XUnit, Headless, Automation, UI Testing

Testing with Headless NUnit

๐Ÿ” Normal

NUnit, Headless, Automation, UI Testing

Testing with Appium

๐Ÿ‰ Hard

XUnit, Appium, WinAppDriver, Automation, UI Testing

๐Ÿง‘โ€๐Ÿ’ป Complete Apps

Sample Difficulty Buzz-Words

Simple ToDo-List

๐Ÿฅ Easy

ToDo-List, Complete App, MVVM, CommunityToolkit.MVVM, Source Generator, Styles, Commands

Music Store App

๐Ÿฅ Easy

Music Store, Complete App, CommunityToolkit.MVVM, Mvvm.Messaging, Styles, ObservableProperty, Commands, iTunes Api

Music Store App (F#)

๐Ÿฅ Easy

F#, Music Store, Complete App, CommunityToolkit.MVVM, Mvvm.Messaging, Styles, ObservableProperty, iTunes Api, Functional Programming

Advanced ToDo-List

๐Ÿ‰ Hard

Todo-List, Cross-Platform, WebAssembly (WASM), SQLite, Service Pattern, Dependency Injection, MVVM Pattern, IndexedDB, Unit Testing, Headless Testing, Persistent Storage, Controls-Library

๐Ÿช› Contribution

Is anything missing? Have you found an error? Have you found an outdated sample? Or do you have a great idea?

Fantastic! Your contribution is welcome.

โ„น๏ธ
Before you start, make sure you have read the Code of Conduct.

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the Contributor Covenant Code of Conduct.

Issues and Feature Requests

If you file a new issue or feature request, please fill in the templates available. If you found an issue in an existing sample, please link the sample and, if possible, point us to what is wrong.

Pull Requests

โ„น๏ธ
Pull requests may be discussed and probably not every pull request will be merged in the end. If you are not sure, please ๐Ÿ—ฏ Get in touch with us first. Anyway, every contribution is welcome.

Fixing an existing sample

If you find that in an existing sample something is unclear or missing, you can update the sample and file a pull request. Spelling mistakes or wrong wording can also be changed in a pull request.

โ—
If you change the difficulty or the buzz-words, remember to also update the main page.

Adding a new sample

  1. Add a new Project to the Solution: src โ–บ Avalonia.Samples โ–บ Avalonia.Samples.sln

  2. In the root directory of the new sample add a README-file. We highly suggest using a template which you can find here:

    1. AsciiDoc-Template: If you want to provide richer content, we suggest using the ascii-doc-template.

    2. Markdown-Template: If you prefer not to use AsciiDoc, you can instead use the Markdown-template.

About

Avalonia.Samples aims to provide some minimal samples focusing on a particular issue at a time. This should help getting new users started.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

โšก