update mainwindow so it shows real installations
This commit is contained in:
parent
297a784956
commit
89c3dcb424
3 changed files with 65 additions and 236 deletions
28
MetaforceInstaller.UI/ViewModels/MainWindowViewModel.cs
Normal file
28
MetaforceInstaller.UI/ViewModels/MainWindowViewModel.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue