This commit is contained in:
2025-11-17 07:31:46 +01:00
parent 7c745cc2f7
commit afc9ceaa1f

View File

@@ -1,12 +1,17 @@
using System.ComponentModel;
namespace ModpackUpdater.Apps.Manager.Ui.Models.UpdatesCollectorViewMode; namespace ModpackUpdater.Apps.Manager.Ui.Models.UpdatesCollectorViewMode;
public record ModUpdateInfo(KeyValuePair<string, string>[] AvailableVersions, InstallAction Origin) public record ModUpdateInfo(KeyValuePair<string, string>[] AvailableVersions, InstallAction Origin) : INotifyPropertyChanged
{ {
public event PropertyChangedEventHandler? PropertyChanged;
public int NewVersion { get; set; } public int NewVersion { get; set; }
public bool Visible { get; set; } = true; public bool Visible { get; set; } = true;
public IEnumerable<string> DisplayVersions { get; } = AvailableVersions.Select(n => public IEnumerable<string> DisplayVersions { get; } = AvailableVersions.Select(n =>
{ {
if (string.IsNullOrWhiteSpace(n.Value) || n.Value == n.Key) if (string.IsNullOrWhiteSpace(n.Value) || n.Value.Equals(n.Key, StringComparison.InvariantCulture))
return n.Key; return n.Key;
return $"{n.Value} ({n.Value})"; return $"{n.Value} ({n.Value})";
}); });