Пример #1
0
        public MenuViewModel(IEnumerable<MenuItemViewModel> items)
        {
            if (items == null)
            {
                throw new ArgumentNullException("items");
            }

            Items = items.ToList();
            ShowCommand = new SimpleCommand(Show);
        }
        public FacultyTreeViewModel(IRepository<Person> professorRepository,
                                    IRepository<Cathedra> cathedraRepository)
        {
            if (professorRepository == null)
            {
                throw new ArgumentNullException("professorRepository");
            }

            if (cathedraRepository == null)
            {
                throw new ArgumentNullException("cathedraRepository");
            }

            _cathedras = Lazy.Create(CreateCathedrasViewModel);

            _professorRepository = professorRepository;
            _cathedraRepository = cathedraRepository;

            cathedraRepository.EntityCreated += OnCathedraCreated;
            cathedraRepository.EntityDeleted += OnCathedraDeleted;

            SearchCommand = new SimpleCommand(OnSearch, CanSearch);
        }