誰かが違いを知っていますか
Dispatcher.BeginInvoke(DispatcherPriority.Background, new ThreadStart(() =>
{
と
Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
{
違いはないはずです。ThreadStartとしてAction定義されます。
public delegate void ThreadStart();
public delegate void Action();
つまり、パラメーターも戻り値もないデリゲートです。したがって、意味的には同じです。
ただし、コンストラクターと強く関連しているため、Actionand notを使用します。ThreadStartThreadStartThreadThreadStart
のコンテキストでとの間に違いがあるようです。ThreadStartActionBeginInvoke
Vlad が述べたように、どちらもデリゲート内でコードを正しく実行します。
ただし、デリゲート内で例外が発生した場合、ThreadStart結果はTargetInvocationException. しかし、使用Actionすると、デリゲートからの正しい例外が得られます。
Actionこのため、優先する必要があります。
この質問を見てください。