complete
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel;
|
||||
using Avalonia.Media;
|
||||
using ModpackUpdater.Apps.Manager.LangRes;
|
||||
using ModpackUpdater.Apps.Manager.Utils;
|
||||
using PropertyChanged;
|
||||
@@ -18,7 +19,7 @@ public class MainWindowGridRow(InstallAction action, IActionSet baseActions) : I
|
||||
private InstallAction Inherited => Base ?? action;
|
||||
|
||||
public bool IsUpdate => action is UpdateAction;
|
||||
public bool? IsValid { get; set; } = null;
|
||||
public IImage? StateImage { get; set; }
|
||||
|
||||
[DependsOn(nameof(Id), nameof(InheritFrom))]
|
||||
public string? InheritedId => action is UpdateAction ua && !string.IsNullOrWhiteSpace(ua.InheritFrom) ? ua.InheritFrom : action.Id;
|
||||
|
||||
@@ -16,7 +16,7 @@ public class MainWindowViewModel : INotifyPropertyChanged
|
||||
private IWorkspace? currentWorkspace;
|
||||
|
||||
public bool IsUpdate => selectedTreeNode is ActionSetTreeNode node && node.Infos is UpdateInfo;
|
||||
|
||||
public ProgressInfos Progress { get; } = new();
|
||||
public MainWindowGridRow? SelectedGridRow { get; set; }
|
||||
|
||||
[AlsoNotifyFor(nameof(CurrentTreeNodes))]
|
||||
|
||||
15
ModpackUpdater.Apps.Manager/Ui/Models/ProgressInfos.cs
Normal file
15
ModpackUpdater.Apps.Manager/Ui/Models/ProgressInfos.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace ModpackUpdater.Apps.Manager.Ui.Models;
|
||||
|
||||
public class ProgressInfos : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
public bool Visible { get; set; }
|
||||
public double MaxValue { get; set; }
|
||||
public double Value { get; set; }
|
||||
[DependsOn(nameof(Value), nameof(MaxValue))]
|
||||
public string? Text => $"{Math.Round(Value / MaxValue * 100)}%";
|
||||
}
|
||||
@@ -7,12 +7,8 @@ namespace ModpackUpdater.Apps.Manager.Ui.Models.UpdatesCollectorViewMode;
|
||||
public class UpdatesCollectorViewModel : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
public bool ProgressVisible { get; set; }
|
||||
public double ProgressMaxValue { get; set; }
|
||||
public double ProgressValue { get; set; }
|
||||
[DependsOn(nameof(ProgressValue), nameof(ProgressMaxValue))]
|
||||
public string? ProgressText => $"{Math.Round(ProgressValue / ProgressMaxValue * 100)}%";
|
||||
|
||||
public ProgressInfos Progress { get; } = new();
|
||||
public string? SearchText { get; set; }
|
||||
public ObservableCollection<ModUpdateInfo> Updates { get; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user