Example #1
0
 protected LedDeviceViewModel(IEventAggregator aggregator, ILocalizationHelper loc, ISettingsService settingsService, IEventListViewModel eventListViewModel, ILedViewModelFactory ledFactory)
 {
     EventAggregator    = aggregator;
     Loc                = loc;
     SettingsService    = settingsService;
     EventListViewModel = eventListViewModel;
     LedFactory         = ledFactory;
     EventAggregator.SubscribeOnUIThread(this);
 }
        public MainViewModel(IMediator mediator,
                             IBandListViewModel bandListViewModel,
                             IFactory <IBandDetailViewModel> bandDetailViewModelFactory,
                             IStageListViewModel stageListViewModel,
                             IFactory <IStageDetailViewModel> stageDetailViewModelFactory,
                             IEventListViewModel eventListViewModel,
                             IFactory <IEventDetailViewModel> eventDetailViewModelFactory,
                             IProgramViewModel programViewModel)
        {
            _mediator                   = mediator;
            BandListViewModel           = bandListViewModel;
            _bandDetailViewModelFactory = bandDetailViewModelFactory;
            BandDetailViewModel         = _bandDetailViewModelFactory.Create();
            CloseBandDetailTabCommand   = new RelayCommand(CloseBandDetailTabCommandExecute);

            mediator.Register <BL.Messages.NewMessage <BandDetailModel> >(OnBandNewMessage);
            mediator.Register <DeleteMessage <BandDetailModel> >(UnselectBand);
            mediator.Register <BL.Messages.UpdateMessage <BandDetailModel> >(UnselectBand);
            mediator.Register <BL.Messages.SelectedMessage <BandDetailModel> >(SelectBand_msg);


            _stageDetailViewModelFactory = stageDetailViewModelFactory;
            StageListViewModel           = stageListViewModel;
            StageDetailViewModel         = _stageDetailViewModelFactory.Create();
            CloseStageDetailTabCommand   = new RelayCommand(CloseStageDetailTabCommandExecute);

            mediator.Register <BL.Messages.NewMessage <StageDetailModel> >(OnStageNewMessage);
            mediator.Register <DeleteMessage <StageDetailModel> >(UnselectStage);
            mediator.Register <BL.Messages.UpdateMessage <StageDetailModel> >(UnselectStage);
            mediator.Register <BL.Messages.SelectedMessage <StageDetailModel> >(SelectStage_msg);


            _eventDetailViewModelFactory = eventDetailViewModelFactory;
            ProgramViewModel             = programViewModel;
            EventListViewModel           = eventListViewModel;
            EventDetailViewModel         = _eventDetailViewModelFactory.Create();
            CloseEventDetailTabCommand   = new RelayCommand(CloseEventDetailTabCommandExecute);

            mediator.Register <BL.Messages.NewMessage <EventDetailModel> >(OnEventNewMessage);
            mediator.Register <DeleteMessage <EventDetailModel> >(UnselectEvent);
            mediator.Register <BL.Messages.UpdateMessage <EventDetailModel> >(UnselectEvent);
            mediator.Register <BL.Messages.SelectedMessage <EventDetailModel> >(SelectEvent_msg);


            CloseApp    = new RelayCommand(CloseAppExecute);
            MinimizeApp = new RelayCommand(MinimizeAppExecute);
            ResizeApp   = new RelayCommand(ResizeAppExecute);
            DragMove    = new RelayCommand(DragMoveExecute);
        }