mirror of
https://github.com/4sval/FModel.git
synced 2026-03-22 09:44:37 -05:00
30 lines
864 B
C#
30 lines
864 B
C#
using System.ComponentModel;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Data;
|
|
using FModel.Framework;
|
|
using FModel.Services;
|
|
using FModel.ViewModels.ApiEndpoints.Models;
|
|
using FModel.Views.Resources.Converters;
|
|
|
|
namespace FModel.ViewModels;
|
|
|
|
public class UpdateViewModel : ViewModel
|
|
{
|
|
public RangeObservableCollection<GitHubCommit> Commits { get; }
|
|
public ICollectionView CommitsView { get; }
|
|
|
|
public UpdateViewModel()
|
|
{
|
|
Commits = new RangeObservableCollection<GitHubCommit>();
|
|
CommitsView = new ListCollectionView(Commits)
|
|
{
|
|
GroupDescriptions = { new PropertyGroupDescription("Commit.Author.Date", new DateTimeToDateConverter()) }
|
|
};
|
|
}
|
|
|
|
public async Task Load()
|
|
{
|
|
Commits.AddRange(await ApplicationService.ApiEndpointView.FModelApi.GetGitHubCommitHistoryAsync());
|
|
}
|
|
}
|