update mainwindow so it shows real installations

This commit is contained in:
Вячеслав 2026-01-01 20:32:38 +05:00
parent 297a784956
commit 89c3dcb424
3 changed files with 65 additions and 236 deletions

View file

@ -0,0 +1,28 @@
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<InstallationData> Installations { get; set; } = new();
public void LoadInstallations(IEnumerable<InstallationData> 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));
}
}