Good morning,
I already implemented a application that loads images from a directory to a listbox. All ok but the loading takes about 5 seconds to display around 20-30 images. Is there a way to decrease the time needed for the images to be loaded. Or is it correct to display an loading image in front of the UI so the user knows images are loading? Thank you in advance for the help. Below is my xaml code for the listbox.
<ListBox Name="Images" ListBox.SelectionChanged="lstImagesChange_Click" Grid.Column="1" ScrollViewer.HorizontalScrollBarVisibility="Disabled" VirtualizingStackPanel.IsVirtualizing="false" VirtualizingStackPanel.VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True"><ListBox.Resources><Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}"><Style.Triggers><Trigger Property="Orientation" Value="Vertical"><Setter Property="Width" Value="20"/><Setter Property="Height" Value="Auto" /></Trigger></Style.Triggers></Style></ListBox.Resources><ListBox.ItemsPanel><ItemsPanelTemplate><WrapPanel IsItemsHost="True" Orientation="Horizontal" FlowDirection="LeftToRight" /></ItemsPanelTemplate></ListBox.ItemsPanel><ListBox.ItemTemplate><DataTemplate><Border BorderThickness="2" BorderBrush="#bb62d8" Background="Black" Width="200" Height="200" Margin="5,5,10,5" CornerRadius="10"><Image Source="{Binding Path=Path, Converter={StaticResource UriToBitmapConverter}}" Tag="{Binding ImageID}" /></Border></DataTemplate></ListBox.ItemTemplate></ListBox>
and below is the code loading the images
if (!(images == null)) { Images.ItemsSource = images; }