public void CleanData()
{
this.Dispatcher.Invoke(new Action(() =>
{
gridControl.ItemsSource = null;
tbToolsTipLoading.Visibility = System.Windows.Visibility.Visible;
tbToolsTip.Visibility = System.Windows.Visibility.Collapsed;
}));
}
在WPF中的UI线程是主线程,当要更新UI界面上的控件时,这时就要使用异步线程更新主线程中的控件。