public static void RegisterForTransitionOrAnimationEnded(this ElementReference elementRef, IJSRuntime jsRuntime, Func <string, Task> onEndedCallback, string transitionOrAnimationName, bool isAnimation)
        {
            var helper = new TransitionHelper(elementRef, onEndedCallback);

#pragma warning disable CS4014 // We don't need the result back so this is fire and forget.
            var dotnetRef = DotNetObjectReference.Create(helper);
            jsRuntime.InvokeAsync <object>("BlazorRegisterAnimationOrTransitionEnd", dotnetRef, elementRef, transitionOrAnimationName, isAnimation);
#pragma warning restore CS4014
        }
Beispiel #2
0
        public static void RegisterForAnimationEnded(this ElementReference elementRef, IJSRuntime jsRuntime, Action <string> animationEndedCallback)
        {
            //var tcs = new TaskCompletionSource<bool>();
            //cancellationToken.Register(() => tcs.TrySetCanceled());
            var helper = new TransitionHelper(elementRef, animationEndedCallback);

#pragma warning disable CS4014 // We don't need the result back so this is fire and forget.
            var dotnetRef = DotNetObjectReference.Create(helper);
            jsRuntime.InvokeAsync <object>("BlazorRegisterAnimationEnd", dotnetRef, elementRef);
#pragma warning restore CS4014
        }