Esempio n. 1
0
 private bool ContentsControlKeyEvent(string keyPressedName)
 {
     if (keyPressedName == "Right")
     {
         if (uriList.MoveToNextTrack())
         {
             var current = uriList.GetCurrentTrack();
             positionBar.Deactivate();
             positionBar = null;
             playerControl.Terminate();
             playerControl = new PlayerControl(current.uri, MainWindow, loadingIcon, current.usePlayready);
             positionBar   = new PositionBar(layout.Children, playerControl);
             playerControl.Resume();
         }
         else
         {
             MessageBox.New("Last Content");
         }
     }
     else if (keyPressedName == "Down")
     {
         positionBar.Activate((uint)playerControl.GetDuration());
     }
     else if (keyPressedName == "Up")
     {
         positionBar.Deactivate();
     }
     else
     {
         return(false);
     }
     return(true);
 }
Esempio n. 2
0
        private void InitializePlayer()
        {
            var current = uriList.GetCurrentTrack();

            if (current != null)
            {
                playerControl = new PlayerControl(current.uri, MainWindow, loadingIcon, current.usePlayready);
                positionBar   = new PositionBar(layout.Children, playerControl);
            }
        }