AsyncImageLoader.Avalonia 2.3.0
AsyncImageLoader.Avalonia
Provides way to asynchronous bitmap loading for Avalonia Image control.
Features:
- Supports urls and downloading from web
- Asynchronous loading
- Integrated inmemory cache
- Integrated disk cache
- Easy to implement your own way of images loading and caching
Getting started
- Install
AsyncImageLoader.Avalonianuget package
dotnet add package AsyncImageLoader.Avalonia
- Start using
Using
The only thing you need to do in your xaml is to replace the Source property in Image with ImageLoader.Source.
For example, your old code:
<Image Source="https://mycoolwebsite.io/image.jpg" />
Should turn into:
<Image asyncImageLoader:ImageLoader.Source="https://mycoolwebsite.io/image.jpg" />
Also you can use ImageLoader.IsLoading readonly attached property that indicates whether the load is in progress or not.
Note: The first time you will need to import the AsyncImageLoader namespace to your xaml file. Usually your IDE should suggest it automatically. The root element in the file will be like this:
<Window ...
xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
...>
<!-- Your root element content -->
About resources and assets
AsyncImageLoader support resm: and avares: links.
And does not support relative referenced assets such as Source="icon.png" or Source="/icon.png". Here's an issue that describes why.
Assets and resources in Avalonia described here.
Loaders
ImageLoader will use instance of IImageLoader for serving your requests.
You can change the loader used by setting new one to the ImageLoader.AsyncImageLoader property. Do not forget to Dispose previous loader.
There are several loaders available out of the box:
- BaseWebImageLoader - Provides non cached way to asynchronously load images without caching. Can be used as base class for custom loaders you dont want caching in any way.
- RamCachedWebImageLoader - This is inheritor if BaseWebImageLoader with in memory images caching. Can be used as base class for custom loaders you want only inmemory caching.
- DiskCachedWebImageLoader - This is inheritor if RamCachedWebImageLoader with in memory caching and disk caching for downloaded from the internet images. Can be used as base class for custom loaders if you want disk caching out of the box.
RamCachedWebImageLoader are used by default.
No packages depend on AsyncImageLoader.Avalonia.
- Make ImageSource.SourceProperty nullable
| Version | Downloads | Last updated |
|---|---|---|
| 4.0.1-nightly.1 | 7 | 10/02/2026 |
| 4.0.0 | 9 | 10/02/2026 |
| 4.0.0-preview1.2 | 7 | 10/02/2026 |
| 4.0.0-preview1.1 | 6 | 10/02/2026 |
| 4.0.0-preview1 | 7 | 10/02/2026 |
| 3.8.0 | 6 | 10/06/2026 |
| 3.7.0 | 5 | 10/02/2026 |
| 3.6.0 | 4 | 10/01/2026 |
| 3.5.0 | 6 | 10/02/2026 |
| 3.4.4 | 5 | 10/02/2026 |
| 3.4.3 | 7 | 10/01/2026 |
| 3.4.2 | 4 | 10/02/2026 |
| 3.4.1 | 8 | 10/02/2026 |
| 3.4.0 | 5 | 10/01/2026 |
| 3.3.0 | 8 | 10/01/2026 |
| 3.2.1 | 8 | 10/01/2026 |
| 3.2.1-rc1 | 5 | 10/01/2026 |
| 3.2.0 | 5 | 10/01/2026 |
| 3.1.0 | 6 | 10/01/2026 |
| 3.0.0 | 8 | 10/02/2026 |
| 3.0.0-avalonia11-preview6 | 8 | 10/01/2026 |
| 3.0.0-avalonia11-preview5 | 6 | 10/01/2026 |
| 3.0.0-avalonia11-preview4 | 5 | 10/02/2026 |
| 3.0.0-avalonia11-preview3 | 5 | 10/02/2026 |
| 3.0.0-avalonia11-preview2 | 7 | 10/02/2026 |
| 3.0.0-avalonia11 | 6 | 10/02/2026 |
| 2.5.0 | 5 | 10/02/2026 |
| 2.4.0 | 6 | 10/01/2026 |
| 2.3.0 | 8 | 10/02/2026 |
| 2.2.0 | 4 | 10/02/2026 |
| 2.1.1 | 5 | 10/06/2026 |
| 2.1.0 | 7 | 10/01/2026 |
| 2.0.1 | 7 | 10/02/2026 |
| 2.0.0 | 7 | 10/02/2026 |
| 1.0.0 | 6 | 10/02/2026 |