ディスパッチャを介してUI要素を更新しようとすると、オブジェクト参照がオブジェクトのインスタンスに設定されていないというエラーが発生します。
サンプルコードは->
backgroundworker.DoWork += >
{
// do some work here.
// close the progressbar over here
_progressBar.Dispatcher.Invoke(DispatcherPriority.Normal,
new Action( _progressBar.Close);
}
_progressBar.Dispatcher.Invokeステートメントで設定されていないオブジェクト参照のエラーが発生し、アプリケーションが完全にハングします。