Exemplo n.º 1
0
        private void BtnStop_Click(object sender, RoutedEventArgs e)
        {
            MediaShowElement.Stop();

            BtnOperator.Style = Resources["MediaBtnPlay"] as Style;
            BtnOperator.Tag   = "Play";
        }
Exemplo n.º 2
0
        void timer_Tick(object sender, EventArgs e)
        {
            if (MediaShowElement.NaturalDuration.HasTimeSpan && !m_IsClickSlider)
            {
                MediaTimeSplider.Value = MediaShowElement.Position.TotalMilliseconds;
                txtNowPostion.Text     = MediaShowElement.Position.Hours.ToString().PadLeft(2, '0') + ":" +
                                         MediaShowElement.Position.Minutes.ToString().PadLeft(2, '0') + ":" +
                                         MediaShowElement.Position.Seconds.ToString().PadLeft(2, '0');
            }

            if (MediaTimeSplider.Value > 0 && MediaTimeSplider.Value == (double)MediaShowElement.Position.Seconds * 1000)
            {
                MediaShowElement.Stop();

                BtnOperator.Style = Resources["MediaBtnPlay"] as Style;
                BtnOperator.Tag   = "Play";
            }
        }