Skip to content

Commit badc101

Browse files
committed
Bump version to v2.4.0, modify README.md with AdvancedImage.
Close #2
1 parent 3cb9401 commit badc101

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

AsyncImageLoader.Avalonia/AsyncImageLoader.Avalonia.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
99
<Title>AsyncImageLoader.Avalonia</Title>
1010
<Authors>SKProCH</Authors>
11-
<Description>Provides way to asynchronous bitmap loading from web for Avalonia Image control</Description>
11+
<Description>Provides way to asynchronous bitmap loading from web for Avalonia Image control and more</Description>
1212
<PackageProjectUrl>https://github.com/AvaloniaUtils/AsyncImageLoader.Avalonia</PackageProjectUrl>
1313
<PackageLicenseUrl>https://github.com/AvaloniaUtils/AsyncImageLoader.Avalonia/blob/master/LICENSE</PackageLicenseUrl>
1414
<RepositoryUrl>https://github.com/AvaloniaUtils/AsyncImageLoader.Avalonia.git</RepositoryUrl>
1515
<RepositoryType>git</RepositoryType>
1616
<PackageTags>image cross-platform avalonia avaloniaui c-sharp-library</PackageTags>
1717
<PackageReadmeFile>README.md</PackageReadmeFile>
18-
<Version>2.3.0</Version>
18+
<Version>2.4.0</Version>
1919
<PackageReleaseNotes>
20-
- Make ImageSource.SourceProperty nullable
20+
- Add AdvancedImage control
2121
</PackageReleaseNotes>
2222
</PropertyGroup>
2323

README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ dotnet add package AsyncImageLoader.Avalonia
1818

1919
## Using
2020

21+
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):
22+
```xaml
23+
<Window ...
24+
xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
25+
...>
26+
<!-- Your root element content -->
27+
```
28+
Note: Assets and resources in Avalonia described [here](https://docs.avaloniaui.net/docs/getting-started/assets).
29+
30+
### ImageLoader attached property
2131
The only thing you need to do in your xaml is to replace the `Source` property in `Image` with `ImageLoader.Source`.
2232
For example, your old code:
2333
```xaml
@@ -27,20 +37,23 @@ Should turn into:
2737
```xaml
2838
<Image asyncImageLoader:ImageLoader.Source="https://mycoolwebsite.io/image.jpg" />
2939
```
30-
Also you can use `ImageLoader.IsLoading` readonly attached property that indicates whether the load is in progress or not.
40+
Also you can use `ImageLoader.IsLoading` readonly attached property that indicates whether the load is in progress or not.
3141

32-
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):
42+
AsyncImageLoader **support** `resm:` and `avares:` links.
43+
And does **not** support relative referenced assets such as `Source="icon.png"` or `Source="/icon.png"`. Use [AdvancedImage control](#advancedimage-control).
44+
45+
### AdvancedImage control
46+
This control provides all capabilities of ImageLoader attached property and **support** relative referenced assets such as `Source="icon.png"` or `Source="/icon.png"`.
47+
Before you go, add following style to you `App.xaml` file and `Application.Styles` section:
3348
```xaml
34-
<Window ...
35-
xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
36-
...>
37-
<!-- Your root element content -->
49+
<StyleInclude Source="avares://AsyncImageLoader.Avalonia/AdvancedImage.axaml" />
3850
```
39-
40-
### About resources and assets
41-
AsyncImageLoader **support** `resm:` and `avares:` links.
42-
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.
43-
Assets and resources in Avalonia described [here](https://docs.avaloniaui.net/docs/getting-started/assets).
51+
And you can use `AdvancedImage` as any other control:
52+
```xaml
53+
<asyncImageLoader:AdvancedImage Width="150" Height="150" Source="../Assets/cat4.jpg" />
54+
```
55+
This control allows to specify a custom IAsyncImageLoader for particular control.
56+
Also, this control has loading indicator support out of the box.
4457

4558
## Loaders
4659
ImageLoader will use instance of [IImageLoader](https://github.com/AvaloniaUtils/AsyncImageLoader.Avalonia/blob/master/AsyncImageLoader.Avalonia/IAsyncImageLoader.cs) for serving your requests.

0 commit comments

Comments
 (0)