WPF强制刷新UI界面
//刷新界面控件
public void Refresh()
{
DispatcherFrame frame = new DispatcherFrame();
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,
new DispatcherOperationCallback(delegate (object f)
{
((DispatcherFrame)f).Continue = false;
return null;
}
), frame);
Dispatcher.PushFrame(frame);
}