示例#1
0
        public void Select(IEnumerable <ElementModelViewModel> elementModels)
        {
            List <LightViewModel> selectedModels = new List <LightViewModel>();

            foreach (var elementModel in elementModels)
            {
                List <LightViewModel> lvmList;
                if (_elementModelMap.TryGetValue(elementModel.ElementModel.Id, out lvmList))
                {
                    foreach (var lightViewModel in lvmList)
                    {
                        if (!lightViewModel.IsSelected)
                        {
                            lightViewModel.IsSelected = true;
                            selectedModels.Add(lightViewModel);
                        }
                    }
                }
            }
            SelectedItems.AddItems(selectedModels);
        }