Browse Source

Switch usages to BetterAsyncImage

pull/629/head
Ionite 7 months ago
parent
commit
224b008cd9
No known key found for this signature in database
  1. 3
      StabilityMatrix.Avalonia/Controls/Inference/ImageFolderCard.axaml
  2. 3
      StabilityMatrix.Avalonia/Controls/Inference/ImageGalleryCard.axaml
  3. 5
      StabilityMatrix.Avalonia/Controls/SelectableImageCard/SelectableImageButton.axaml
  4. 11
      StabilityMatrix.Avalonia/Styles/ControlThemes/BetterComboBoxStyles.axaml
  5. 5
      StabilityMatrix.Avalonia/Views/CheckpointsPage.axaml
  6. 12
      StabilityMatrix.Avalonia/Views/CivitAiBrowserPage.axaml
  7. 3
      StabilityMatrix.Avalonia/Views/Dialogs/OpenArtWorkflowDialog.axaml
  8. 5
      StabilityMatrix.Avalonia/Views/InstalledWorkflowsPage.axaml
  9. 7
      StabilityMatrix.Avalonia/Views/OpenArtBrowserPage.axaml
  10. 3
      StabilityMatrix.Avalonia/Views/PackageManagerPage.axaml

3
StabilityMatrix.Avalonia/Controls/Inference/ImageFolderCard.axaml

@ -10,6 +10,7 @@
xmlns:vmInference="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Inference"
xmlns:scroll="clr-namespace:StabilityMatrix.Avalonia.Controls.Scroll"
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs"
x:DataType="vmInference:ImageFolderCardViewModel">
<Design.PreviewWith>
@ -196,7 +197,7 @@
<Border ClipToBounds="True" CornerRadius="8">
<Grid RowDefinitions="*,Auto">
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Width="{Binding $parent[ItemsRepeater].((vmInference:ImageFolderCardViewModel)DataContext).ImageSize.Width}"
Height="{Binding $parent[ItemsRepeater].((vmInference:ImageFolderCardViewModel)DataContext).ImageSize.Height}"
Source="{Binding AbsolutePath}"

3
StabilityMatrix.Avalonia/Controls/Inference/ImageGalleryCard.axaml

@ -6,6 +6,7 @@
xmlns:models="clr-namespace:StabilityMatrix.Avalonia.Models"
xmlns:vmInference="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Inference"
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs"
x:DataType="vmInference:ImageGalleryCardViewModel">
<Design.PreviewWith>
@ -116,7 +117,7 @@
</ListBox.Styles>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:ImageSource}">
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
MaxHeight="65"
CornerRadius="4"
Source="{Binding Uri}"

5
StabilityMatrix.Avalonia/Controls/SelectableImageCard/SelectableImageButton.axaml

@ -2,7 +2,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:selectableImageCard="clr-namespace:StabilityMatrix.Avalonia.Controls.SelectableImageCard"
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls"
xmlns:controls1="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls">
xmlns:controls1="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs">
<Design.PreviewWith>
<Border Padding="20">
<!-- Add Controls for Previewer Here -->
@ -39,7 +40,7 @@
CornerRadius="12"
Command="{TemplateBinding Command}"
CommandParameter="{TemplateBinding CommandParameter}">
<controls1:AsyncImage
<vendorLabs:BetterAsyncImage
Stretch="UniformToFill"
CornerRadius="8"
ContextFlyout="{TemplateBinding ContextFlyout}"

11
StabilityMatrix.Avalonia/Styles/ControlThemes/BetterComboBoxStyles.axaml

@ -7,7 +7,8 @@
xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core"
xmlns:sg="clr-namespace:SpacedGridControl.Avalonia;assembly=SpacedGridControl.Avalonia"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls">
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs">
<Design.PreviewWith>
<Panel Width="450" Height="600">
@ -43,7 +44,7 @@
ColumnSpacing="6"
RowSpacing="0">
<!-- Image -->
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Width="64"
Height="96"
CornerRadius="6"
@ -125,7 +126,7 @@
ColumnSpacing="8"
TextBlock.TextTrimming="CharacterEllipsis"
TextBlock.TextWrapping="NoWrap">
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Grid.RowSpan="2"
Width="42"
Height="42"
@ -213,7 +214,7 @@
ColumnSpacing="8"
TextBlock.TextTrimming="CharacterEllipsis"
TextBlock.TextWrapping="NoWrap">
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Grid.RowSpan="2"
Width="36"
Height="36"
@ -221,7 +222,7 @@
RenderOptions.BitmapInterpolationMode="HighQuality"
Source="{Binding Local.PreviewImageFullPathGlobal}"
Stretch="UniformToFill">
</labs:AsyncImage>
</vendorLabs:BetterAsyncImage>
<!-- Text -->
<sg:SpacedGrid

5
StabilityMatrix.Avalonia/Views/CheckpointsPage.axaml

@ -14,6 +14,7 @@
xmlns:generic="clr-namespace:System.Collections.Generic;assembly=System.Collections"
xmlns:converters="clr-namespace:StabilityMatrix.Avalonia.Converters"
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs"
d:DataContext="{x:Static mocks:DesignData.CheckpointsPageViewModel}"
x:CompileBindings="True"
x:DataType="vm:CheckpointsPageViewModel"
@ -139,7 +140,7 @@
TextWrapping="WrapWithOverflow"
IsVisible="{Binding IsConnectedModel}" />
<!-- Image -->
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Margin="0,0,0,4"
CornerRadius="4"
Source="{Binding PreviewImagePath}"
@ -176,7 +177,7 @@
IsVisible="{Binding IsConnectedModel}" />
</StackPanel>
<labs:AsyncImage Grid.Row="1"
<vendorLabs:BetterAsyncImage Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="0, 4,0,4"

12
StabilityMatrix.Avalonia/Views/CivitAiBrowserPage.axaml

@ -17,6 +17,7 @@
xmlns:helpers="clr-namespace:StabilityMatrix.Avalonia.Helpers"
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs"
d:DataContext="{x:Static designData:DesignData.CivitAiBrowserViewModel}"
d:DesignHeight="700"
d:DesignWidth="800"
@ -103,7 +104,7 @@
CommandParameter="{Binding CivitModel}"
IsEnabled="{Binding !IsImporting}">
<Grid RowDefinitions="*, Auto">
<labs:AsyncImage Grid.Row="0"
<vendorLabs:BetterAsyncImage Grid.Row="0"
CornerRadius="8"
VerticalAlignment="Top"
HorizontalAlignment="Center"
@ -115,8 +116,8 @@
<!-- <controls:BetterAdvancedImage.RenderTransform> -->
<!-- <RotateTransform Angle="315"></RotateTransform> -->
<!-- </controls:BetterAdvancedImage.RenderTransform> -->
</labs:AsyncImage>
<labs:AsyncImage
</vendorLabs:BetterAsyncImage>
<vendorLabs:BetterAsyncImage
Grid.Row="0"
Grid.RowSpan="2"
CornerRadius="8"
@ -182,15 +183,14 @@
Classes="transparent"
Padding="10,4">
<StackPanel Orientation="Horizontal" Spacing="6">
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Width="22"
Height="22"
Effect="{StaticResource ImageDropShadowEffect}"
CornerRadius="11"
RenderOptions.BitmapInterpolationMode="HighQuality"
IsVisible="{Binding CivitModel.Creator.Image, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Source="{Binding CivitModel.Creator.Image}">
</labs:AsyncImage>
Source="{Binding CivitModel.Creator.Image}"/>
<TextBlock
VerticalAlignment="Center"
Effect="{StaticResource TextDropShadowEffect}"

3
StabilityMatrix.Avalonia/Views/Dialogs/OpenArtWorkflowDialog.axaml

@ -13,6 +13,7 @@
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs"
d:DataContext="{x:Static designData:DesignData.OpenArtWorkflowViewModel}"
d:DesignHeight="650"
d:DesignWidth="600"
@ -36,7 +37,7 @@
<Run Text="{Binding Workflow.Creator.Name}" />
</TextBlock>
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Grid.Row="2"
Grid.Column="0"
Height="300"

5
StabilityMatrix.Avalonia/Views/InstalledWorkflowsPage.axaml

@ -15,6 +15,7 @@
xmlns:helpers="clr-namespace:StabilityMatrix.Avalonia.Helpers"
xmlns:fluent="clr-namespace:FluentIcons.Avalonia.Fluent;assembly=FluentIcons.Avalonia.Fluent"
xmlns:input="clr-namespace:FluentAvalonia.UI.Input;assembly=FluentAvalonia"
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
d:DataContext="{x:Static designData:DesignData.InstalledWorkflowsViewModel}"
x:DataType="viewModels:InstalledWorkflowsViewModel"
@ -164,7 +165,7 @@
VerticalContentAlignment="Top"
CornerRadius="8">
<Grid RowDefinitions="*, Auto">
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Grid.Row="0"
Grid.RowSpan="2"
CornerRadius="8"
@ -210,7 +211,7 @@
Classes="transparent"
Padding="10,4">
<StackPanel Orientation="Horizontal" Spacing="6">
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Width="22"
Height="22"
Effect="{StaticResource ImageDropShadowEffect}"

7
StabilityMatrix.Avalonia/Views/OpenArtBrowserPage.axaml

@ -13,6 +13,7 @@
xmlns:input="clr-namespace:FluentAvalonia.UI.Input;assembly=FluentAvalonia"
xmlns:viewModels="clr-namespace:StabilityMatrix.Avalonia.ViewModels"
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs"
x:DataType="viewModels:OpenArtBrowserViewModel"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="StabilityMatrix.Avalonia.Views.OpenArtBrowserPage">
@ -106,7 +107,7 @@
Command="{StaticResource OpenWorkflowCommand}"
CommandParameter="{Binding }">
<Grid RowDefinitions="*, Auto">
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Grid.Row="0"
Grid.RowSpan="2"
CornerRadius="8"
@ -143,7 +144,7 @@
Classes="transparent"
Padding="10,4">
<StackPanel Orientation="Horizontal" Spacing="6">
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Width="22"
Height="22"
ClipToBounds="True"
@ -152,7 +153,7 @@
RenderOptions.BitmapInterpolationMode="HighQuality"
IsVisible="{Binding Creator.Avatar, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Source="{Binding Creator.Avatar}">
</labs:AsyncImage>
</vendorLabs:BetterAsyncImage>
<TextBlock
VerticalAlignment="Center"
Foreground="{DynamicResource TextControlForeground}"

3
StabilityMatrix.Avalonia/Views/PackageManagerPage.axaml

@ -14,6 +14,7 @@
xmlns:avalonia="clr-namespace:SpacedGridControl.Avalonia;assembly=SpacedGridControl.Avalonia"
xmlns:markupExtensions="clr-namespace:StabilityMatrix.Avalonia.MarkupExtensions"
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs"
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="450"
x:DataType="viewModels:PackageManagerViewModel"
x:CompileBindings="True"
@ -45,7 +46,7 @@
</MultiBinding>
</controls:Card.Background>
<Grid ColumnDefinitions="Auto, *">
<labs:AsyncImage
<vendorLabs:BetterAsyncImage
Grid.Column="0"
Height="150"
Width="150"

Loading…
Cancel
Save