Added some animations, fixed crash when reopening folder

This commit is contained in:
Ano-sys
2026-03-21 17:13:20 +01:00
parent 54268fc0b4
commit d286282f71
4 changed files with 221 additions and 29 deletions
+4 -3
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
@@ -96,7 +97,7 @@ public static partial class PhotoExtension
.ToList();
}
public static void CreateAndAddPhotosToList(List<string> photos, string rootPath, IList<Photo> toAddTo)
public static void CreateAndAddPhotosToList(List<string> photos, string rootPath, ObservableCollection<Photo> toAddTo)
{
var bag = new ConcurrentBag<Photo>();
@@ -105,12 +106,12 @@ public static partial class PhotoExtension
bag.Add(new Photo(p, rootPath));
});
Dispatcher.UIThread.InvokeAsync(() =>
Dispatcher.UIThread.Invoke(() =>
{
foreach (var photo in bag)
{
toAddTo.Add(photo);
}
}).GetAwaiter().GetResult(); // TODO: When reopening folder this throws exception
}); // TODO: When reopening folder this throws exception
}
}