AsyncImageLoader.Avalonia 3.0.0-avalonia11-preview2

This is a prerelease version of AsyncImageLoader.Avalonia.
There is a newer version of this package available.
See the version list below for details.
dotnet add package AsyncImageLoader.Avalonia --version 3.0.0-avalonia11-preview2                
NuGet\Install-Package AsyncImageLoader.Avalonia -Version 3.0.0-avalonia11-preview2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AsyncImageLoader.Avalonia" Version="3.0.0-avalonia11-preview2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AsyncImageLoader.Avalonia --version 3.0.0-avalonia11-preview2                
#r "nuget: AsyncImageLoader.Avalonia, 3.0.0-avalonia11-preview2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AsyncImageLoader.Avalonia as a Cake Addin
#addin nuget:?package=AsyncImageLoader.Avalonia&version=3.0.0-avalonia11-preview2&prerelease

// Install AsyncImageLoader.Avalonia as a Cake Tool
#tool nuget:?package=AsyncImageLoader.Avalonia&version=3.0.0-avalonia11-preview2&prerelease                

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

  1. Install AsyncImageLoader.Avalonia nuget package
dotnet add package AsyncImageLoader.Avalonia
  1. Start using

Using

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"
        ...>
   

Note: Assets and resources in Avalonia described here.

ImageLoader attached property

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.

AsyncImageLoader support resm: and avares: links. And does not support relative referenced assets such as Source="icon.png" or Source="/icon.png". Use AdvancedImage control.

AdvancedImage control

This control provides all capabilities of ImageLoader attached property and support relative referenced assets such as Source="icon.png" or Source="/icon.png". Before you go, add following style to you App.xaml file and Application.Styles section:

<StyleInclude Source="avares://AsyncImageLoader.Avalonia/AdvancedImage.axaml" />

And you can use AdvancedImage as any other control:

<asyncImageLoader:AdvancedImage Width="150" Height="150" Source="../Assets/cat4.jpg" />

This control allows to specify a custom IAsyncImageLoader for particular control.
Also, this control has loading indicator support out of the box.

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.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

  • .NETStandard 2.1

NuGet packages (2)

Showing the top 2 NuGet packages that depend on AsyncImageLoader.Avalonia:

Package Downloads
Pwa.Stories

is similar like Instagram Stories

Iciclecreek.AdaptiveCards.Rendering.Avalonia

AdaptiveCard renderer for AvaloniauUI

GitHub repositories (12)

Showing the top 5 popular GitHub repositories that depend on AsyncImageLoader.Avalonia:

Repository Stars
Tyrrrz/YoutubeDownloader
Downloads videos and playlists from YouTube
Tyrrrz/DiscordChatExporter
Exports Discord chat logs to a file
LykosAI/StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
Tyrrrz/YoutubeExplode
Abstraction layer over YouTube's internal API
PixiEditor/PixiEditor
PixiEditor is a pixel art editor made with .NET 8
Version Downloads Last updated
3.3.0 9,043 8/17/2024
3.2.1 29,977 9/26/2023
3.2.1-rc1 122 9/23/2023
3.2.0 2,976 8/8/2023
3.1.0 336 7/30/2023
3.0.0 728 7/17/2023
3.0.0-avalonia11-preview6 795 6/1/2023
3.0.0-avalonia11-preview5 164 5/27/2023
3.0.0-avalonia11-preview4 457 3/27/2023
3.0.0-avalonia11-preview3 630 2/6/2023
3.0.0-avalonia11-preview2 390 11/13/2022
3.0.0-avalonia11 1,438 8/23/2022
2.5.0 408 5/22/2023
2.4.0 4,220 7/19/2022
2.3.0 438 7/16/2022
2.2.0 653 6/18/2022
2.1.1 455 6/8/2022
2.1.0 458 11/13/2021
2.0.1 332 11/10/2021
2.0.0 307 11/10/2021
1.0.0 394 11/9/2021

- Implement CornerRadius for AdvancedImage
- This release contains only Avalonia 11 support