I want to display a lot of pictures. To do this, all the pictures are full of information. Every time I want to display images of a specific category, I check all the images, each one that has the corresponding label, I'll separate it and show it. It takes a lot of time and the program stops.
What should I do?
IEnumerable<string> AllofItems;
IEnumerable<string> CurrentofItems;
private void Window_Loaded(object sender, RoutedEventArgs e)
{
AllofItems = GetFileList(@"E:\DL\newArtWork\Art").ToArray();
}
private void Listbox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
foreach (var item in AllofItems)
{
var file = ShellFile.FromFilePath(item);
var auth = file.Properties.System.Author.Value;
if (listbox.SelectedItem.ToString().Equals(auth))
currentList.Add(item);
}
CurrentofItems = currentList;
CurrentofItems.ForEachWithIndex((item, idx) =>
{
cover.Items.Add(item);
});
}
note:There are about 100 to 300 photos in each category
note:There are 9 thousand files in this place
E:\DL\newArtWork\Art