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 Updates { get; } = new(FilterUpdates); private static Func FilterUpdates(string? searchText) { return n => string.IsNullOrWhiteSpace(searchText) || (n.Origin.Name != null && n.Origin.Name.Contains(searchText, StringComparison.InvariantCultureIgnoreCase)); } }