尽管接受率为25%,但这里是:
AddHandler m_TextBox.Loaded, AddressOf TextBoxLoaded
RemoveHandler m_TextBox.Loaded, AddressOf TextBoxLoaded
Private Sub TextBoxLoaded(ByVal sender as Object, ByVal e as RoutedEventArgs)
Init()
End Sub
如VB所示,请打电话到<代码>AddValueChanged可直接翻译。 NET s lambda expression support is not as well as C# s. 特别是,VB。 NET lambdas必须是一种表述,因此,你必须交回价值,或打上。 如果是的话,请打电话Sub
,在VB中允许。 NET。 您应考虑将<代码>UpdateAdorner的签名改为标准活动手稿(如TextBoxLod
和通过AddressOf UpdateAdoerner
至AddValueChanged
。
与此类似:
containsTextProp.AddValueChanged(m_TextBox, AddressOf UpdateAdorner);
...
Private Sub UpdateAdorner(ByVal sender as Object, ByVal e as EventArgs)
...
End Sub