Ejemplo n.º 1
0
 private static void UnbindFromPlayer(VoiceMessagePlayer control)
 {
     // ISSUE: method pointer
     VoiceMessagePlayer.Player.MediaOpened -= (new RoutedEventHandler(control.OnMediaOpened));
     // ISSUE: method pointer
     VoiceMessagePlayer.Player.MediaEnded             -= (new RoutedEventHandler(control.OnMediaEnded));
     VoiceMessagePlayer.Player.MediaFailed            -= (new EventHandler <ExceptionRoutedEventArgs>(control.OnMediaFailed));
     ((FrameworkElement)VoiceMessagePlayer.Player).Tag = null;
 }
Ejemplo n.º 2
0
        public static void ResetPlayerData()
        {
            VoiceMessagePlayer tag = ((FrameworkElement)VoiceMessagePlayer.Player).Tag as VoiceMessagePlayer;

            if (tag == null)
            {
                return;
            }
            tag._timerPlayback.Stop();
            tag.IsPlaying = false;
            Action resetCallback = tag.ResetCallback;

            if (resetCallback != null)
            {
                resetCallback();
            }
            VoiceMessagePlayer.UnbindFromPlayer(tag);
        }
Ejemplo n.º 3
0
 private void ResetPlayer()
 {
     VoiceMessagePlayer.ResetPlayerData();
     this.BindToPlayer();
 }