22 lines
797 B
C#
22 lines
797 B
C#
using System.Collections.ObjectModel;
|
|
using System.ComponentModel;
|
|
using System.Reactive;
|
|
using System.Reactive.Linq;
|
|
using System.Reactive.Subjects;
|
|
using DynamicData;
|
|
using PropertyChanged;
|
|
|
|
namespace ModpackUpdater.Apps.Manager.Ui.Models.UpdatesCollectorViewMode;
|
|
|
|
public class UpdatesCollectorViewModel : INotifyPropertyChanged
|
|
{
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
public ProgressInfos Progress { get; } = new();
|
|
public DynamicDataView<ModUpdateInfo> Updates { get; } = new(FilterUpdates);
|
|
|
|
private static Func<ModUpdateInfo, bool> FilterUpdates(string? searchText)
|
|
{
|
|
return n => string.IsNullOrWhiteSpace(searchText) || (n.Origin.Name != null && n.Origin.Name.Contains(searchText, StringComparison.InvariantCultureIgnoreCase));
|
|
}
|
|
} |