C# to VB: Class.Event += (sender, args) => FunctionName(params)

佐手、 提交于 2019-12-01 23:11:14
AddHandler fadeOutAnimation.Completed, Sub() 
    OnFadeOutAnimationCompleted(d, hostGrid, grid)
End Sub

It's been a while, but since you're not using the parameters in the Event Handler I don't think you need to include them (because of Relaxed Delegate Conversion). If so, it'll look more like:

AddHandler fadeOutAnimation.Completed, Sub(sender as object, args as EventArgs) 
    OnFadeOutAnimationCompleted(d, hostGrid, grid)
End Sub

This is a lambda expression. Let me see how to do this in VB...

AddHandler fadeOutAnimation.Completed, Sub(sender, e) _
(OnFadeOutAnimationCompleted(d, hostGrid, grid))

They keywork you have to look for is "lambda expression".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!