using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Runtime.CompilerServices; using MetaforceInstaller.Core.Models; namespace MetaforceInstaller.UI.ViewModels; public class MainWindowViewModel : INotifyPropertyChanged { public event PropertyChangedEventHandler? PropertyChanged; public ObservableCollection Installations { get; set; } = new(); public void LoadInstallations(IEnumerable data) { Installations.Clear(); foreach (var installation in data) { Installations.Add(installation); } } protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } }