c# - WPF 中的空闲检测

标签 c# wpf idle-timer

我是 WPF 的新手,所以我不知道如何检测空闲时间并在空闲 5 分钟后显示主窗口。

谁能帮帮我?非常感谢。

最佳答案

你可以做到;

var timer = new DispatcherTimer (
    TimeSpan.FromMinutes(5),
    DispatcherPriority.ApplicationIdle,// Or DispatcherPriority.SystemIdle
    (s, e) => { mainWindow.Activate(); }, // or something similar
    Application.Current.Dispatcher
);

取自 here

关于c# - WPF 中的空闲检测,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23286766/

相关文章:

c# - 管理描述性 URL

c# - 登录页面防伪 token

c# - 交互 - IInteractionRequestAware 属性未填充

wpf - 显示组合框所选项目的数据网格详细信息

javascript - ReactJS : How to detect network idle between XHR requests

c# - 对于 .NET 3.5 以外的任何项目,不能在 c# 项目中命中断点

c# - 在 linux 机器上运行 c# 应用程序时 SOAP 身份验证失败

wpf - 如何暂停 Storyboard?

android - Adobe AIR 移动应用程序 (iOS/Android) 的空闲计时器

android - android 中的空闲时间?