public IEnumerable <(IGraphViewModel graphViewModel, int priority)> GetLeftSideViewModels() { List <IGraphViewModel> allCharts = _viewModelFactory.CreateAll <IGraphViewModel>().ToList(); List <IGraphViewModel> chartsToReturn = allCharts.Where(_graphsSettingsProvider.IsGraphViewModelLeft).ToList(); allCharts.Except(chartsToReturn).ForEach(x => x.Dispose()); return(chartsToReturn.Select(x => (x, _graphsSettingsProvider.GetGraphPriority(x)))); }
public SessionDefinitionViewModel(IViewModelFactory viewModelFactory) { _viewModelFactory = viewModelFactory; AvailableSessionLengthDefinitionViewModels = _viewModelFactory.CreateAll <ISessionLengthDefinitionViewModel>().ToList(); SelectedSessionLengthDefinitionViewModel = AvailableSessionLengthDefinitionViewModels.First(); _points = new int[15]; ScoringTemplates = Common.Championship.Scoring.Templates.ScoringTemplates.AllTemplates.OrderBy(x => x.Name).ToArray(); }