Ejemplo n.º 1
0
        public CommentEditBoxPresentationModel(ICommentEditBox view, ICommentViewPreview preview, IEventAggregator eventAggregator, ITimelineModel timelineModel, IConfigurationService configurationService)
        {
            this.View                 = view;
            this.preview              = preview;
            this.eventAggregator      = eventAggregator;
            this.timelineModel        = timelineModel;
            this.configurationService = configurationService;
            this.timelineModel.CommentElements.CollectionChanged += this.CommentElements_CollectionChanged;
            this.preview.SetTimelineDuration(this.timelineModel.Duration);

            this.CloseCommand  = new DelegateCommand <object>(this.Close);
            this.SaveCommand   = new DelegateCommand <object>(this.Save, this.CanSave);
            this.DeleteCommand = new DelegateCommand <object>(this.Delete);
            this.PlayCommand   = new DelegateCommand <object>(this.PlayComment);

            this.comment = this.CreateComment();
            this.timelineModel.AddComment(this.comment);

            this.eventAggregator.GetEvent <CommentUpdatedEvent>().Subscribe(x => this.UpdateComment(), ThreadOption.PublisherThread, true, x => this.comment == x);

            this.View.Model    = this;
            this.preview.Model = this;
        }
Ejemplo n.º 2
0
        public CommentEditBoxPresentationModel(ICommentEditBox view, ICommentViewPreview preview, IEventAggregator eventAggregator, ISequenceRegistry sequenceRegistry, IConfigurationService configurationService)
        {
            this.View                 = view;
            this.preview              = preview;
            this.eventAggregator      = eventAggregator;
            this.configurationService = configurationService;
            this.sequenceRegistry     = sequenceRegistry;
            this.sequenceRegistry.CurrentSequence.CommentElements.CollectionChanged += this.CommentElements_CollectionChanged;
            this.preview.SetTimelineDuration(this.sequenceRegistry.CurrentSequenceModel.Duration);

            this.CloseCommand          = new DelegateCommand <object>(this.Close);
            this.SaveCommand           = new DelegateCommand <string>(this.Save, this.CanSave);
            this.DeleteCommand         = new DelegateCommand <object>(this.Delete);
            this.PlayCommand           = new DelegateCommand <object>(this.PlayComment);
            this.KeyboardActionCommand = new DelegateCommand <Tuple <KeyboardAction, object> >(this.ExecuteKeyboardAction, this.CanExecuteKeyboardAction);

            this.comment = this.CreateComment();
            this.sequenceRegistry.CurrentSequence.AddComment(this.comment);

            this.eventAggregator.GetEvent <CommentUpdatedEvent>().Subscribe(x => this.UpdateComment(), ThreadOption.PublisherThread, true, x => this.comment == x);

            this.View.Model    = this;
            this.preview.Model = this;
        }