Q:

Pausing window wpf application

I'd like to play a video when no mouse action is launch and the cursor is not moving for 10 seconds. 
I tried this code:
private void dispatcherTimer_Tick(object sender, EventArgs e)
        {
            Test t = new Test();
            t.Show();
        }

        public void declencher() {
            try
            {
                while (Mouse. Captured ! = null)
                {
                    dispatcherTimer = new DispatcherTimer();
                    dispatcherTimer. Tick += new EventHandler(dispatcherTimer_Tick);
                    dispatcherTimer. Interval = new TimeSpan(0, 0, 0, 0, 12);
                    dispatcherTimer. Start();
                    MessageBox. Show("hhh");
                }
            }
            catch { }

        }

I'd like to know how can i test this condition in WPF and what is the best method to do it

A:

check this code
 if (button1.Content. Equals("Play"))
            {
                button1.Content = "Pause";
                mediaElement1.Play();
            }
            else
            {
                button1.Content = "Play";
                mediaElement1.Pause();
            }

