Now to the point.
I converted a lot of code, and I had some errors in the conversion. There is one that I can't seem to figure it out:
Expand|Select|Wrap|Line Numbers
- Private Function MakeAnimation(ByVal [to] As Double, ByVal duration As Double, ByVal endEvent As EventHandler) As DoubleAnimation
- Dim anim As New DoubleAnimation([to], TimeSpan.FromMilliseconds(duration))
- anim.AccelerationRatio = 0.2
- anim.DecelerationRatio = 0.7
- If endEvent IsNot Nothing Then
- anim.Completed += endEvent
- End If
- Return anim
- End Function
Error 1 'Public Event Completed(sender As Object, e As System.EventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
I've tried to use this
Expand|Select|Wrap|Line Numbers
- AddHandler anim.Completed, AddressOf endEvent
This code works perfectly in C#, but I don't know how to figure it out in VB.Net
Edit:
Some time ago, this issue was discussed, but the solution code wasn't shown