Made improvements on loading photos

This commit is contained in:
Ano-sys
2026-03-21 14:40:30 +01:00
parent 7f632531fd
commit 54268fc0b4
8 changed files with 189 additions and 53 deletions
+23 -13
View File
@@ -14,6 +14,10 @@
Title="Photos"
DragDrop.AllowDrop="True"
DragDrop.Drop="DropHandler"
ExtendClientAreaChromeHints="NoChrome"
TransparencyLevelHint="AcrylicBlur"
Background="Transparent"
ExtendClientAreaToDecorationsHint="True"
>
<Design.DataContext>
@@ -27,30 +31,36 @@
<Button Content="Open Directory" Command="{Binding OpenDirectory}"/>
</Menu>
<ScrollViewer Grid.Column="1">
<ItemsControl ItemsSource="{Binding Photos}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel ScrollViewer.VerticalScrollBarVisibility="Auto"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<ItemsRepeater ItemsSource="{Binding Photos}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ItemsRepeater.Layout>
<UniformGridLayout MinItemWidth="190"
MinItemHeight="240"
MinRowSpacing="12"
MinColumnSpacing="12" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<DataTemplate DataType="models:Photo">
<StackPanel Orientation="Vertical" Margin="20">
<StackPanel Orientation="Vertical" Margin="12">
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="PointerReleased">
<ic:InvokeCommandAction Command="{Binding DataContext.PhotoClicked, ElementName=Root}" PassEventArgsToCommand="True"/>
</ic:EventTriggerBehavior>
</i:Interaction.Behaviors>
<Image Source="{Binding Source}" Width="150" Height="150"/>
<TextBlock Text="{Binding DisplayName}" HorizontalAlignment="Center" Width="150"/>
<Image Source="{Binding PreviewImage}"
Width="150"
Height="150" />
<TextBlock Text="{Binding DisplayName}"
HorizontalAlignment="Center"
Width="150" />
<TextBlock Text="{Binding DisplayPath}" HorizontalAlignment="Center" Width="150"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ScrollViewer>
<Grid Grid.Column="0" Grid.ColumnSpan="2" IsEnabled="{Binding SelectedPhoto}">
<Image Source="{Binding SelectedPhoto.Source}" Margin="50">
<Image Source="{Binding SelectedPhoto.FullImage}" Margin="50">
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="PointerReleased">
<ic:InvokeCommandAction Command="{Binding Path=SelectedPhotoClicked}"/>