|
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
4 | 4 | xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" |
5 | 5 | xmlns:controls="clr-namespace:CodeSoupCafe.Maui.Controls;assembly=CodeSoupCafe.Maui" |
| 6 | + xmlns:behaviors="clr-namespace:CodeSoupCafe.Maui.Behaviors;assembly=CodeSoupCafe.Maui" |
6 | 7 | xmlns:viewModels="clr-namespace:LunaDraw.Logic.ViewModels" |
7 | 8 | x:Class="LunaDraw.Components.DrawingGalleryPopup" |
8 | 9 | x:Name="Popup" |
|
47 | 48 | <controls:ItemGalleryView Grid.Row="1" |
48 | 49 | x:Name="GalleryView" |
49 | 50 | ItemsSource="{Binding DrawingItems}" |
| 51 | + ItemAppearingAction="{Binding OnItemAppearing}" |
| 52 | + ItemDisappearingAction="{Binding OnItemDisappearing}" |
| 53 | + RemainingItemsThreshold="10" |
50 | 54 | Title="Gallery" |
51 | 55 | SearchPlaceholder="Search drawings..." |
52 | 56 | EmptyMessage="No drawings yet. Start creating!" |
|
85 | 89 | <Grid> |
86 | 90 | <!-- Actual thumbnail --> |
87 | 91 | <Image x:Name="ThumbnailImage" |
88 | | - Source="{Binding ThumbnailSource}" |
| 92 | + Source="{Binding ThumbnailBase64, Converter={StaticResource Base64ToImageConverter}}" |
89 | 93 | Aspect="AspectFit" |
90 | 94 | WidthRequest="170" |
91 | 95 | HeightRequest="170" |
92 | 96 | HorizontalOptions="FillAndExpand" |
93 | 97 | VerticalOptions="FillAndExpand" |
94 | 98 | BackgroundColor="Transparent" |
95 | | - IsVisible="{Binding ThumbnailSource, Converter={StaticResource IsNotNullConverter}}" |
96 | | - Loaded="OnThumbnailImageLoaded" |
97 | | - PropertyChanged="OnThumbnailImagePropertyChanged"/> |
| 99 | + IsVisible="{Binding ThumbnailBase64, Converter={StaticResource IsNotNullConverter}}"/> |
| 100 | + |
| 101 | + <!-- Loading indicator --> |
| 102 | + <ActivityIndicator IsRunning="{Binding IsLoadingThumbnail}" |
| 103 | + IsVisible="{Binding IsLoadingThumbnail}" |
| 104 | + Color="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}" |
| 105 | + HorizontalOptions="Center" |
| 106 | + VerticalOptions="Center"/> |
98 | 107 |
|
99 | 108 | <!-- Placeholder when no thumbnail --> |
100 | 109 | <Label Text="🎨" |
101 | 110 | FontSize="48" |
102 | 111 | HorizontalOptions="Center" |
103 | 112 | VerticalOptions="Center" |
104 | 113 | TextColor="{AppThemeBinding Light={StaticResource PlaceholderTextLight}, Dark={StaticResource PlaceholderTextDark}}" |
105 | | - IsVisible="{Binding ThumbnailSource, Converter={StaticResource IsNullConverter}}"/> |
| 114 | + IsVisible="{Binding ThumbnailBase64, Converter={StaticResource IsNullConverter}}"/> |
106 | 115 | </Grid> |
107 | 116 | </Border> |
108 | 117 |
|
|
0 commit comments