Exemplo n.º 1
0
        /// <summary>
        /// Accures when a clip is ready for crossfade
        /// </summary>
        /// <param name="sender"></param>
        void Clip_ReadyForCrossfade(IClipPresenter sender)
        {
            sender.ReadyForCrossfade     -= Clip_ReadyForCrossfade;
            sender.ExitSequenceCompleted += Clip_ExitSequenceCompleted;
            sender.StartExitSequence();

            if (UpcomingClip != null && sender.HidesPreviousClip)
            {
                TransitToNextClip(UpcomingClip);
            }
        }
Exemplo n.º 2
0
        IClipPresenter TransitToNextClip(Clip nextClip)
        {
            var nextPresenter = _factory.CreatePresenterForClip(nextClip);

            _presenterInFocus = nextPresenter;

            Presenters.Add(nextPresenter);

            nextPresenter.StartEntranceSequence();

            nextPresenter.ReadyForCrossfade += Clip_ReadyForCrossfade;

            return(nextPresenter);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Accures when a clip that is in exit sequence completes the sequence. Should be removed.
        /// </summary>
        /// <param name="sender"></param>
        void Clip_ExitSequenceCompleted(IClipPresenter sender)
        {
            sender.ExitSequenceCompleted -= Clip_ExitSequenceCompleted;
            Presenters.Remove(sender);

            if (!sender.HidesPreviousClip && sender == _presenterInFocus && Presenters.Count > 0)
            {
                _presenterInFocus = Presenters[0];
                CurrentClip       = Presenters[0].OriginalClip;
            }

            if (sender.HidesPreviousClip)
            {
                AdvanceCurrentClip();
            }
            else
            {
                AdvanceUpcomingClip();
            }

            NextClipCommand.RaiseCanExecuteChanged();
        }
Exemplo n.º 4
0
 /// <summary>
 /// Happens when a presenter which his exit sequence was started when he was not Presenters[0], only need
 /// to remove from presenters.
 /// </summary>
 /// <param name="obj"></param>
 void SubClip_ExitSequenceCompleted(IClipPresenter sender)
 {
     sender.ExitSequenceCompleted -= SubClip_ExitSequenceCompleted;
     Presenters.Remove(sender);
     NextClipCommand.RaiseCanExecuteChanged();
 }