|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using DownKyi.Core.Settings;
|
|
|
|
|
using DownKyi.Core.Logging;
|
|
|
|
|
using DownKyi.Core.Settings;
|
|
|
|
|
using DownKyi.Services;
|
|
|
|
|
using DownKyi.Utils;
|
|
|
|
|
using Prism.Commands;
|
|
|
|
@ -40,22 +41,13 @@ namespace DownKyi.ViewModels.DownloadManager
|
|
|
|
|
{
|
|
|
|
|
// 初始化DownloadedList
|
|
|
|
|
DownloadedList = App.DownloadedList;
|
|
|
|
|
DownloadedList.CollectionChanged += new NotifyCollectionChangedEventHandler(async (object sender, NotifyCollectionChangedEventArgs e) =>
|
|
|
|
|
{
|
|
|
|
|
await Task.Run(() =>
|
|
|
|
|
DownloadedList.CollectionChanged += new NotifyCollectionChangedEventHandler((sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
if (e.Action == NotifyCollectionChangedAction.Add)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in DownloadedList)
|
|
|
|
|
{
|
|
|
|
|
if (item != null && item.DialogService == null)
|
|
|
|
|
{
|
|
|
|
|
item.DialogService = dialogService;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SetDialogService();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
SetDialogService();
|
|
|
|
|
|
|
|
|
|
DownloadFinishedSort finishedSort = SettingsManager.GetInstance().GetDownloadFinishedSort();
|
|
|
|
@ -143,6 +135,8 @@ namespace DownKyi.ViewModels.DownloadManager
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
private async void SetDialogService()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
await Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
@ -155,6 +149,12 @@ namespace DownKyi.ViewModels.DownloadManager
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
Core.Utils.Debugging.Console.PrintLine("SetDialogService()发生异常: {0}", e);
|
|
|
|
|
LogManager.Error($"{Tag}.SetDialogService()", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnNavigatedFrom(NavigationContext navigationContext)
|
|
|
|
|
{
|
|
|
|
|