private void videosCleared(object sender, EventArgs e) { WindowUtil.Invoke(() => { gridVideo.Children.Clear(); }); }
private void monitor() { try { while (true) { Thread.Sleep(1000); if (_safeStop) { break; } WindowUtil.Invoke(new Action(monitorProcess)); } } catch (ThreadAbortException) { //不处理异常。 } catch (NullReferenceException) { //在应用程序关闭时的异常。 } }
void setPane(object pane) { WindowUtil.Invoke(() => { _contentControl.Content = pane; }); }