tags:

views:

44

answers:

2
Private Sub ChangeCursor(ByVal target As FrameworkElement, ByVal cursor As Cursor)
    target.Dispatcher.Invoke(DispatcherPriority.Normal,
        New DispatcherOperationCallback( _
            Function()
                Mouse.OverrideCursor = cursor
                Return Nothing
            End Function),
        Nothing)
End Sub

and

Private Sub ChangeCursor(ByVal target As FrameworkElement, ByRef cursor As Cursor)

    target.Dispatcher.Invoke(DispatcherPriority.Normal,
        New DispatcherOperationCallback( _
            Function(cursor1 as Cursor)
                Mouse.OverrideCursor = cursor1
                Return Nothing
            End Function),
        cursor)
End Sub
A: 

By "in function" do you mean "in terms of what they do"? If so then I'd have to say yes.

Dan Tao
+1  A: 

The 2nd snippet is probably cheaper. The lambda doesn't have to capture the value of the cursor argument. They are otherwise functionally the same. Try not to sweat the small stuff.

Hans Passant