I got this code from msdn http://code.msdn.microsoft.com/eventbehaviourfactor
I have most of it converted but having an issue with the following sub getting it converted correctly
Protected Overrides Sub AdjustEventHandlers(ByVal sender As DependencyObject, ByVal oldValue As Object, ByVal newValue As Object)
Dim element As UIElement = TryCast(sender, UIElement)
If element Is Nothing Then
Return
End If
If oldValue IsNot Nothing Then
element.[RemoveHandler](_routedEvent, New RoutedEventHandler(EventHandler))
End If
If newValue IsNot Nothing Then
element.[AddHandler](_routedEvent, New RoutedEventHandler(EventHandler))
End If
End Sub
I didnt want to put the whole class in the post but the above link takes you to the code in C# EventBehaviourFactory This is the class I am trying to convert.
Thanks you!