这并没有做任何事情,只是导致需要进行不必要的强制转换(或者更确切地说,导致我拉下代码库并自己进行更改)。这样做有理由吗?
参考:
编辑 这是一个例子:
DoCommand = new RelayCommand<AsyncCallback>((callBack) =>
{
Console.WriteLine("In the Action<AsyncCallback>");
SomeAsyncFunction((async_result) =>
{
Console.WriteLine("In the AsyncCallback");
callBack.Invoke(new MyAsyncResult(true));
});
});
DoCommand.Execute((iasyncresult) => Console.WriteLine(iasyncresult.IsCompleted));
//Where MyAsyncResult is a class implement IAsyncResult that sets IsCompleted in the constructor
// This will cause the "cannot cast lambda as object" error