また、このディスパッチャを別のBeginInvokeと再利用すると、 "Dispatcher.Run"が再度必要になりますか?Dispatcher.BeginInvokeを使用しているときに、/なぜDispatcher.Runを呼び出す必要があるのですか?
var thread = new Thread(() =>
{
this.dispatcher = Dispatcher.CurrentDispatcher;
this.dispatcher .BeginInvoke(new Action(() =>
{
try
{
do something
}
catch (Exception ex)
{
onNotify(ex);
}
}));
Dispatcher.Run();
});
thread.Name = string.Format("{0} Hook Thread", this.GetType().Name);
thread.IsBackground = true;
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
何をしようとしていますか? – SLaks
特定のタイプのすべての呼び出しを非UIスレッド(ただし、その1つのスレッドのみ)で実行しようとしています – tofutim