public PlaybillViewModel(IEventAggregator eventAggregator, IMediaFileImageResolver imageResolver, PlayItemCollection playItemCollection, InteractionRequests interactionRequests, IPlayoutConfiguration playoutConfig, IUserService userService) { _playoutConfig = playoutConfig; _interactionRequests = interactionRequests; _userService = userService; _playItemCollection = playItemCollection; this.ImageResolver = imageResolver; _savePlaybillCommand = new DelegateCommand(SavePlaybill, CanSavePlaybill); _loadPlaybillCommand = new DelegateCommand(LoadPlaybill, CanLoadPlaybill); _loadFirstPlaybillCommand = new DelegateCommand(LoadFirstPlaybill, CanLoadFirstPlaybill); //Playbill = new Playbill(); this.Playlist = new Playlist(_playItemCollection); this.Playlist.EditCompleted += Playlist_EditCompleted; _listAdapter = new WrappedItemListAdapter <BindablePlayItem, IPlayItem>(_playItemCollection, (i) => _playItemCollection.CreateBindablePlayItem(i)); _deletePlayItemCommand = new DelegateCommand(DeletePlayItem, CanDeletePlayItem); //_editMediaItemCommand = new DelegateCommand<object>(EditMediaItem, CanEditMediaItem); _editDurationCommand = new DelegateCommand(EditDuration, CanEditDuration); _changeStartTimeCommand = new DelegateCommand(ChangeStartTime, CanChangeStartTime); _changeToAutoModeCommand = new DelegateCommand(ChangeToAutoMode, CanChangeToAutoMode); _changeToBreakModeCommand = new DelegateCommand(ChangeToBreakMode, CanChangeToBreakMode); _changeToTimingModeCommand = new DelegateCommand(ChangeToTimingMode, CanChangeToTimingMode); _moveUpCommand = new DelegateCommand(MoveUp, CanMoveUp); _moveDownCommand = new DelegateCommand(MoveDown, CanMoveDown); // _saveXmlCommand = new DelegateCommand(SaveXml, CanSaveXml); _openXmlCommand = new DelegateCommand(OpenXml); _clearCommand = new DelegateCommand(Clear, CanClear); _editCGItemsCommand = new DelegateCommand(EditCGItems, CanEditCGItems); _previewCommand = new DelegateCommand <IPlayableItem>(Preview); _forcePlayCommand = new DelegateCommand(ForcePlay, CanForcePlay); _eventAggregator = eventAggregator; _eventAggregator.GetEvent <PubSubEvent <AddPlayItemPayload> >().Subscribe(AddPlayItem); _changeSourceCommand = new DelegateCommand(ChangeSource, CanChangeSource); _eventAggregator.GetEvent <PubSubEvent <MediaItem?> >().Subscribe((i) => this.SelectedMediaItem = i); _changeSourceAndDurationCommand = new DelegateCommand(ChangeSourceAndDuration, CanChangeSourceAndDuration); }
public DbMediaItemListViewModel(IEventAggregator eventAggregator, IMediaFilePathResolver filePathResolver, IMediaFileImageResolver imageResolver, IRegionManager regionManager, IMediaFileService mediaService) { this.EventAggregator = eventAggregator; this.FilePathResolver = filePathResolver; this.ImageResolver = imageResolver; this.MediaFileService = mediaService; _regionManager = regionManager; _mediaItemCollection = new ObservableCollection <BindableFileMediaItem>(); _editMediaItemCommand = new DelegateCommand <object>(EditMediaItem, CanEditMediaItem); _searchCommand = new DelegateCommand <RequestPagingItemsEventArgs>(SearchMediaItems); _previewCommand = new DelegateCommand <IPlayableItem>(Preview); this.SearchOptions = new MediaItemSearchOptions(); }