// This method never gets called
public void DoSomethingWithByte(byte b)
{
Writeline(b);
}
class Test<T>
{
public Test(Action<T> act, T data)
{
Dispatcher.Current.BeginInvoke(act, data);
}
}
void TestAll()
{
new Test<Byte>(DoSomethingWithByte, 6);
}
这不起作用,为什么?
它编译,到达该行,但不调用该方法
为什么会这样?