public ErrorViewModel(DefaultWorkspace workspace, IErrorToolboxToolbarService errorToolbox, IEventAggregator eventAggregator) : base(errorToolbox) { _eventAggregator = eventAggregator; _errorToolbox = errorToolbox; _items = new ObservableCollection <ErrorListItem>(); _items.CollectionChanged += (sender, e) => { OnPropertyChanged(() => FilteredItems); OnPropertyChanged(() => ErrorItemCount); OnPropertyChanged(() => WarningItemCount); OnPropertyChanged(() => MessageItemCount); _eventAggregator.GetEvent <ErrorListUpdated>().Publish(new ErrorListUpdated()); }; Name = "Error"; Title = "Error"; ContentId = "Error";//TODO : Move to constants IsVisible = false; _view = new ErrorUserControl(this); View = _view; }
public void Initialize() { _eventAggregator.GetEvent <SplashScreenUpdateEvent>().Publish(new SplashScreenUpdateEvent { Text = "Loading Error Module..." }); _container.RegisterType <ErrorViewModel>(); _container.RegisterType <IErrorToolboxToolbarService, ErrorListToolboxToolbarService>(new ContainerControlledLifetimeManager()); _container.RegisterType <IErrorService, ErrorViewModel>(new ContainerControlledLifetimeManager()); _errorViewModel = _container.Resolve <ErrorViewModel>(); _errorToolbarService = _container.Resolve <IErrorToolboxToolbarService>(); LoadCommands(); LoadToolbar(); _workspace.Tools.Add(_errorViewModel); _eventAggregator.GetEvent <ErrorListUpdated>().Subscribe(UpdateToggleBarTexts); }