示例#1
0
        private void OnPlaybackStateChanged(PlaybackStateCompat state)
        {
            var message = new PlaybackStateChangedMessage
            {
                State = (PlaybackState)state.State
            };

            MessagingCenter.Send(message, nameof(PlaybackStateChangedMessage));
        }
示例#2
0
        private void PlaybackStateChanged(PlaybackStateChangedMessage message)
        {
            PlaybackState = message.PlaybackState;

            if (message.PlaybackState == PlaybackState.Playing)
            {
                _trackProgressTimer.Start();
            }
            else
            {
                _trackProgressTimer.Stop();
            }
        }