public StatisticVM(Action <Type> changeWindowContent, IReposStatistic reposStatistic) { windowsChanger = changeWindowContent ?? throw new ArgumentNullException(nameof(windowsChanger)); this.reposStatistic = reposStatistic; UsersStatisticDto usersStatisticDto = reposStatistic.LoadStatistic(); UserStatistic[] users = usersStatisticDto.UsersStatistic.Values.Select(u => new UserStatistic() { Name = u.Name, Win = u.Win, Lose = u.Lose, Draw = u.Draw }).ToArray(); Users = new ObservableCollection <UserStatistic>(users); }
public UsersStatisticDto LoadStatistic() { return(RepoStatistic.LoadStatistic()); }