Esempio n. 1
0
        public MethodMainViewModel(IEventAggregator aggregator,
                                   IDataService <LabDbEntities> labDbData,
                                   ISpecificationService specificationService) : base()
        {
            _labDbData            = labDbData;
            _eventAggregator      = aggregator;
            _specificationService = specificationService;

            DeleteMethodCommand = new DelegateCommand(
                () =>
            {
                _selectedMethod.Delete();
            },
                () => IsSpecAdmin && _selectedMethod != null);

            NewMethodCommand = new DelegateCommand(
                () =>
            {
                _specificationService.CreateMethod();
            },
                () => IsSpecAdmin);

            _eventAggregator.GetEvent <MethodChanged>().Subscribe(
                tkn => RaisePropertyChanged("MethodList"));
        }