예제 #1
0
        /// <summary>
        /// Called when [media state changed].
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="oldValue">The old value.</param>
        /// <param name="newValue">The new value.</param>
        /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
        public Task OnMediaStateChanged(MediaEngine sender, PlaybackStatus oldValue, PlaybackStatus newValue)
        {
            if (Parent == null)
            {
                return(Task.CompletedTask);
            }

            // Force a reportable position when the media state changes
            Parent.ReportablePosition = sender.State.Position;
            return(Parent.RaiseMediaStateChangedEvent(
                       (System.Windows.Controls.MediaState)oldValue,
                       (System.Windows.Controls.MediaState)newValue));
        }