Added some animations, fixed crash when reopening folder
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user