Ejemplo n.º 1
0
        //private IPlaylist _playlist;

        public MainViewModel(/*ITimer timer*/ IUserService userService, InteractionRequests interactionRequests, IEventAggregator eventAggregator)
            : base(userService)
        {
            //eventAggregator.GetEvent<PubSubEvent<IPlayableItem>>().Subscribe(Preview);

            this.PreviewInteractionRequest        = interactionRequests.PreviewInteractionRequest;
            this.OpenFileInteractionRequest       = interactionRequests.OpenFileInteractionRequest;
            this.DisplayMessageInteractionRequest = interactionRequests.DisplayMessageInteractionRequest;
            this.ConfirmationInteractionRequest   = interactionRequests.ConfirmationInteractionRequest;
            this.EditDurationInteractionRequest   = interactionRequests.EditDurationInteractionRequest;
            this.EditDateTimeInteractionRequest   = interactionRequests.EditDateTimeInteractionRequest;
            this.EditCGItemsInteractionRequest    = interactionRequests.EditCGItemsInteractionRequest;
            this.SaveFileInteractionRequest       = interactionRequests.SaveFileInteractionRequest;
            this.LoadPlaybillInteractionRequest   = interactionRequests.LoadPlaybillInteractionRequest;

            //_timer = timer;

            //_playItemCollection = new ObservableCollection<IPlayItem>();
            //_playItemsView = new CollectionView(_playItemCollection);



            //_playbill = new Playbill();
            //_playbill.PlayItemsChanged += Playbill_PlayItemsChanged;

            //_playlist = new Playlist();

            _collectGarbageCommand = new DelegateCommand(ExecuteCollectGarbage);

            _editCGItemsCommand = new DelegateCommand(EditCGItems);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public MediaItemListViewModel(IEventAggregator eventAggregator, IMediaFilePathResolver filePathResolver,
                                      IMediaFileImageResolver imageResolver, IRegionManager regionManager, InteractionRequests interactionRequests,
                                      IMediaFileService mediaFileService)
        {
            this.EventAggregator  = eventAggregator;
            this.FilePathResolver = filePathResolver;
            this.ImageResolver    = imageResolver;
            this.MediaFileService = mediaFileService;
            _interactionRequests  = interactionRequests;
            _regionManager        = regionManager;

            //_mediaItemCollection = new ObservableCollection<BindableMediaFileItem>();
            _mediaItemCollection = new ObservableCollection <BindableFileMediaItem>();

            //_deleteMediaItemCommand = new DelegateCommand(DeleteMediaItem, CanDeleteMediaItem);
            _editMediaItemCommand = new DelegateCommand <object>(EditMediaItem, CanEditMediaItem);

            _searchCommand = new DelegateCommand <RequestPagingItemsEventArgs>(SearchMediaItems);

            _previewCommand    = new DelegateCommand <IPlayableItem>(Preview);
            this.SearchOptions = new MediaItemSearchOptions();
        }