WPF 线程更新主线程UI方法

WPF禁止跨线程调用线程UI,需使用委托方式完成线程调用,如下线程更新主线程UI方法spa

App.Current.Dispatcher.Invoke((Action)delegate()
{
    //要更新的UI代码
​​​​​​​    
}