Ejemplo n.º 1
0
 public SettingsViewModel(SettingsModel model = null) : base(model)
 {
     DefaultValues = new ObservableModelCollection <object>(Model.DefaultValues);
     Groups        = new ObservableViewModelCollection <ToolGroupViewModel, ToolGroup>(Model.Groups, g => new ToolGroupViewModel(g));
     Tools         = new ObservableViewModelCollection <ToolViewModel, Tool>(Model.Tools, m =>
     {
         var viewModel = ToolViewModel.GetViewModel(m);
         var found     = Groups.FirstOrDefault(g => g == viewModel.Group);
         if (found != null)
         {
             viewModel.Group = found;
         }
         return(viewModel);
     }, v =>
     {
         var found = Groups.FirstOrDefault(g => g == v.Group);
         if (found != null)
         {
             v.Group = found;
         }
     });
 }
Ejemplo n.º 2
0
 public ScoredTeamResultRowViewModel()
 {
     scoredResultRows = new ObservableModelCollection <ScoredResultRowViewModel, ScoredResultRowModel>();
     ScoredResultRows.SortDescriptions.Add(new SortDescription(nameof(FinalPosition), ListSortDirection.Ascending));
 }
 private void PopulateTermOperators()
 {
     if (this.AllTermOperators == null)
     {
         this.AllTermOperators = new ObservableModelCollection<FilterOperator>();
         this.AllTermOperators.Add(FilterOperator.IsLessThan);
         this.AllTermOperators.Add(FilterOperator.IsEqualTo);
         this.AllTermOperators.Add(FilterOperator.IsGreaterThan);
     }
 }