|
1 | 1 | using System.Collections.ObjectModel;
|
2 |
| -using System.Windows.Input; |
| 2 | +using System.Reactive; |
3 | 3 | using DynamicData;
|
4 | 4 | using LiveChartsCore;
|
5 | 5 | using LiveChartsCore.SkiaSharpView;
|
6 | 6 | using NexusMods.App.UI.Controls.DataGrid;
|
7 | 7 | using NexusMods.App.UI.Controls.DownloadGrid;
|
8 | 8 | using NexusMods.App.UI.Pages.Downloads.ViewModels;
|
9 | 9 | using NexusMods.App.UI.WorkspaceSystem;
|
| 10 | +using ReactiveUI; |
10 | 11 |
|
11 | 12 | namespace NexusMods.App.UI.Pages.Downloads;
|
12 | 13 |
|
13 | 14 | public interface IInProgressViewModel : IPageViewModelInterface
|
14 | 15 | {
|
15 | 16 | /// <summary>
|
16 |
| - /// These tasks contain only current in-progress tasks; completed tasks are removed from this list. |
| 17 | + /// Collection of in progress download tasks (downloading, paused, etc.) |
17 | 18 | /// </summary>
|
18 |
| - ReadOnlyObservableCollection<IDownloadTaskViewModel> Tasks { get; } |
| 19 | + ReadOnlyObservableCollection<IDownloadTaskViewModel> InProgressTasks { get; } |
| 20 | + |
| 21 | + /// <summary> |
| 22 | + /// Collection of completed download tasks |
| 23 | + /// </summary> |
| 24 | + ReadOnlyObservableCollection<IDownloadTaskViewModel> CompletedTasks { get; } |
19 | 25 |
|
20 | 26 | ReadOnlyObservableCollection<IDataGridColumnFactory<DownloadColumn>> Columns { get; }
|
21 | 27 |
|
@@ -49,51 +55,38 @@ public interface IInProgressViewModel : IPageViewModelInterface
|
49 | 55 | /// <summary>
|
50 | 56 | /// The currently selected task.
|
51 | 57 | /// </summary>
|
52 |
| - SourceList<IDownloadTaskViewModel> SelectedTasks { get; set;} |
| 58 | + SourceList<IDownloadTaskViewModel> SelectedInProgressTasks { get; } |
| 59 | + |
| 60 | + |
| 61 | + SourceList<IDownloadTaskViewModel> SelectedCompletedTasks { get; } |
53 | 62 |
|
54 | 63 | /// <summary>
|
55 | 64 | /// Shows the cancel 'dialog' to the user.
|
56 | 65 | /// </summary>
|
57 |
| - ICommand ShowCancelDialogCommand { get; set; } |
| 66 | + ReactiveCommand<Unit,Unit> ShowCancelDialogCommand { get; } |
58 | 67 |
|
59 | 68 | /// <summary>
|
60 | 69 | /// Suspends the current task.
|
61 | 70 | /// </summary>
|
62 |
| - ICommand SuspendSelectedTasksCommand { get; } |
| 71 | + ReactiveCommand<Unit,Unit> SuspendSelectedTasksCommand { get; } |
63 | 72 |
|
64 | 73 | /// <summary>
|
65 | 74 | /// Resumes the current task.
|
66 | 75 | /// </summary>
|
67 |
| - ICommand ResumeSelectedTasksCommand { get; } |
| 76 | + ReactiveCommand<Unit,Unit> ResumeSelectedTasksCommand { get; } |
68 | 77 |
|
69 | 78 | /// <summary>
|
70 | 79 | /// Suspends all the tasks.
|
71 | 80 | /// </summary>
|
72 |
| - ICommand SuspendAllTasksCommand { get; } |
| 81 | + ReactiveCommand<Unit,Unit> SuspendAllTasksCommand { get; } |
73 | 82 |
|
74 | 83 | /// <summary>
|
75 | 84 | /// Resumes all the tasks.
|
76 | 85 | /// </summary>
|
77 |
| - ICommand ResumeAllTasksCommand { get; } |
78 |
| - |
79 |
| - /// <summary> |
80 |
| - /// Shows the additional settings for the current task (there is nothing for now). |
81 |
| - /// </summary> |
82 |
| - ICommand ShowSettings { get; } |
83 |
| - |
84 |
| - /// <summary> |
85 |
| - /// Cancels all the passed tasks, without asking for confirmation. |
86 |
| - /// </summary> |
87 |
| - void CancelTasks(IEnumerable<IDownloadTaskViewModel> tasks); |
88 |
| - |
89 |
| - /// <summary> |
90 |
| - /// Suspends all the "Downloading" passed tasks. |
91 |
| - /// </summary> |
92 |
| - void SuspendTasks(IEnumerable<IDownloadTaskViewModel> tasks); |
93 |
| - |
94 |
| - /// <summary> |
95 |
| - /// Resumes all the "Paused" passed tasks. |
96 |
| - /// </summary> |
97 |
| - void ResumeTasks(IEnumerable<IDownloadTaskViewModel> tasks); |
| 86 | + ReactiveCommand<Unit,Unit> ResumeAllTasksCommand { get; } |
| 87 | + |
| 88 | + ReactiveCommand<Unit, Unit> HideSelectedCommand { get; } |
| 89 | + |
| 90 | + ReactiveCommand<Unit, Unit> HideAllCommand { get; } |
98 | 91 |
|
99 | 92 | }
|
0 commit comments