From badc101772533192f075d97c79ba19ce31ed1052 Mon Sep 17 00:00:00 2001 From: SKProCH Date: Tue, 19 Jul 2022 23:34:27 +0300 Subject: [PATCH] Bump version to v2.4.0, modify README.md with AdvancedImage. Close #2 --- .../AsyncImageLoader.Avalonia.csproj | 6 ++-- README.md | 35 +++++++++++++------ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/AsyncImageLoader.Avalonia/AsyncImageLoader.Avalonia.csproj b/AsyncImageLoader.Avalonia/AsyncImageLoader.Avalonia.csproj index a167a94..5bce84f 100644 --- a/AsyncImageLoader.Avalonia/AsyncImageLoader.Avalonia.csproj +++ b/AsyncImageLoader.Avalonia/AsyncImageLoader.Avalonia.csproj @@ -8,16 +8,16 @@ true AsyncImageLoader.Avalonia SKProCH - Provides way to asynchronous bitmap loading from web for Avalonia Image control + Provides way to asynchronous bitmap loading from web for Avalonia Image control and more https://github.com/AvaloniaUtils/AsyncImageLoader.Avalonia https://github.com/AvaloniaUtils/AsyncImageLoader.Avalonia/blob/master/LICENSE https://github.com/AvaloniaUtils/AsyncImageLoader.Avalonia.git git image cross-platform avalonia avaloniaui c-sharp-library README.md - 2.3.0 + 2.4.0 -- Make ImageSource.SourceProperty nullable +- Add AdvancedImage control diff --git a/README.md b/README.md index e807a74..c6d1ea5 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,16 @@ dotnet add package AsyncImageLoader.Avalonia ## Using +Note: The first time you will need to import the AsyncImageLoader namespace to your xaml file. Usually your IDE should [suggest it automatically](https://user-images.githubusercontent.com/29896317/140953397-00028365-5b93-4e6c-b470-094a555870c8.png). The root element in the file will be [like this](https://github.com/AvaloniaUtils/AsyncImageLoader.Avalonia/blob/master/AsyncImageLoader.Avalonia.Demo/Views/MainWindow.axaml#L6): +```xaml + + +``` +Note: Assets and resources in Avalonia described [here](https://docs.avaloniaui.net/docs/getting-started/assets). + +### 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: ```xaml @@ -27,20 +37,23 @@ Should turn into: ```xaml ``` -Also you can use `ImageLoader.IsLoading` readonly attached property that indicates whether the load is in progress or not. +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](https://user-images.githubusercontent.com/29896317/140953397-00028365-5b93-4e6c-b470-094a555870c8.png). The root element in the file will be [like this](https://github.com/AvaloniaUtils/AsyncImageLoader.Avalonia/blob/master/AsyncImageLoader.Avalonia.Demo/Views/MainWindow.axaml#L6): +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). + +### 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: ```xaml - - + ``` - -### 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](https://github.com/AvaloniaUtils/AsyncImageLoader.Avalonia/issues/2) that describes why. -Assets and resources in Avalonia described [here](https://docs.avaloniaui.net/docs/getting-started/assets). +And you can use `AdvancedImage` as any other control: +```xaml + +``` +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](https://github.com/AvaloniaUtils/AsyncImageLoader.Avalonia/blob/master/AsyncImageLoader.Avalonia/IAsyncImageLoader.cs) for serving your requests.