public void SetElement(object value, CommentMode mode) { var newPlayByPlay = value as RCE.Services.Contracts.PlayByPlay; if (newPlayByPlay != null) { this.CommentMode = mode; if (mode == CommentMode.Timeline) { this.sequenceRegistry.CurrentSequence.Markers.Remove(this.playByPlay); } this.playByPlay = newPlayByPlay; if (mode == CommentMode.Timeline) { if (!this.sequenceRegistry.CurrentSequence.Markers.Contains(this.playByPlay)) { this.sequenceRegistry.CurrentSequence.Markers.Add(this.playByPlay); } } this.playByPlay.PropertyChanged += this.PlayByPlayPropertyChanged; this.SetPosition(TimeSpan.FromTicks(this.playByPlay.Time)); this.DisplayView.Close(); this.EditView.Close(); } }
public PlayByPlayBoxesPresentationModel(IPlayByPlayDisplayBox displayView, IPlayByPlayEditBox editView, IPlayByPlayViewPreview preview, ISequenceRegistry sequenceRegistry, IEventAggregator eventAggregator) { this.DisplayView = displayView; this.EditView = editView; this.preview = preview; this.sequenceRegistry = sequenceRegistry; this.eventAggregator = eventAggregator; this.CloseCommand = new DelegateCommand <object>(this.Close); this.SaveCommand = new DelegateCommand <object>(this.Save, this.CanSave); this.DeleteCommand = new DelegateCommand <object>(this.Delete); this.playByPlay = new RCE.Services.Contracts.PlayByPlay(0); this.DisplayView.Model = this; this.EditView.Model = this; this.preview.Model = this; }