我想在未启动鼠标操作且光标未移动 10 秒时播放视频。我试过这段代码:
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 { }
}
我想知道如何在 WPF 中测试这种情况以及最好的方法是什么