Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
How to wait when image load is completed #15815
I need to load image in canvas, than to do another drawings.
It looks like js itself is starting async task and calls callback when it's done.
Actually I need exactly to know (in c# code) when image is loaded, to do next steps.
Can't find correct way for this, tried several approaches (including js interop async calls) no one was successful.
One solution (with I didn't tried) can be to call .net method from img.onload as callback, but to be honest I don't need to have callback hell in my blazor code.
Can js interop solve this case already?
Maybe I am doing or saying something wrong, or this is not correct place for asking.
As writen in blazor js interop documentation
So it is intended to be used for my case.
With this I can give control back to c# from js, it is solution for sure but bit ugly one.
Hope we will have better options in the future.
Here is video regarding this issue.