示例#1
0
        private void MediaButton_Click(object sender, RoutedEventArgs e)
        {
            switch ((sender as Button).Name)
            {
            case "PlayButton": DemoMovie.Play(); break;

            case "PauseButton": DemoMovie.Pause(); break;

            case "StopButton": DemoMovie.Stop(); break;
            }
        }
示例#2
0
        private void Grid_KeyDown(object sender, KeyRoutedEventArgs e)
        {
            if (e.Key == VirtualKey.Control)
            {
                isCtrlKeyPressed = true;
            }
            else if (isCtrlKeyPressed)
            {
                switch (e.Key)
                {
                case VirtualKey.P: DemoMovie.Play(); break;

                case VirtualKey.A: DemoMovie.Pause(); break;

                case VirtualKey.S: DemoMovie.Stop(); break;
                }
            }
        }