I have the following in C #:
public static void StartAnimation(UIElement animatableElement, DependencyProperty dependencyProperty, double toValue, double animationDurationSeconds, EventHandler completedEvent) { double fromValue = (double)animatableElement.GetValue(dependencyProperty); DoubleAnimation animation = new DoubleAnimation(); animation.From = fromValue; animation.To = toValue; animation.Duration = TimeSpan.FromSeconds(animationDurationSeconds);
I have some problems converting an anonymous method to VB.NET.
My option would be
AddHandler animation.Completed, Function(sender As Object, e As EventArgs) As Boolean ' ' ' When the animation has completed bake final value of the animation ' ' into the property. ' ' animatableElement.SetValue(dependencyProperty, animatableElement.GetValue(dependencyProperty)) CancelAnimation(animatableElement, dependencyProperty) completedEvent(sender, e) Return True End Function
I added Function As Boolean , because without a return type it is not a function, but creating a βSubβ I donβt know how ...
Some tips?
source share