Exemplo n.º 1
0
        void UpdateStatistics()
        {
            StatisticsViewModel stat = new StatisticsViewModel();

            foreach (var e in AllModels.Where(z => z.Selected))
            {
                stat.EpisodesCount += e.Model.Montage.Information.Episodes.Count;
                stat.TotalClean    += (int)e.Model.Montage.Information.Episodes.Sum(z => z.Duration.TotalMinutes);
                stat.TotalDirty    += e.Model.Montage.Chunks.Where(z => z.Mode != Mode.Undefined).Sum(z => z.Length) / 60000;
            }
            Statistics = stat;
            this.NotifyByExpression(z => z.Statistics);
        }
 private IEnumerable <ToDoViewModel> GetToDoModelsByCondition(Func <ToDoViewModel, bool> predicate) =>
 AllModels
 .Where(predicate)
 .OrderByDescending(x => x.WhenHappens);