WPF 主窗口关闭时结束所有相关线程

程序主窗口的 Closed 事件中添加代码:

Process.GetCurrentProcess().Kill();

原文地址:https://www.cnblogs.com/dhqy/p/9621172.html