微软对WPF线程的描述如下:
“Typically, WPF applications start with two threads: one for handling rendering and another for managing the UI. The rendering thread effectively runs hidden in the background while the UI thread receives input, handles events, paints the screen, and runs application code. Most applications use a single UI thread, although in some situations it is best to use several.”
WPF应用程序都至少有两个线程,一个用于UI绘制,隐藏于后台,另一个用于管理UI,包括用响应用户输入执行后台代码等。
using System;
using System.Windows;
using System.ComponentModel;
BackgroundWo