As SetImage is async void and not awaited, if it trows an error it cannot be caught and the app crashes.
If you do a quick search for "async void", you'll see that XF has this issue in many places (ignoring event handlers). Fixing them all will cause certain methods to be async even though they are not meant to be.
For example, how would one handle GetCell() of iOS ImageCellRenderer?
Also, SetImage() is handling TaskCanceledException so the user doesn't have to worry about it, but it wouldn't handle other types of exceptions. Since we're trying to load an image, I'm wondering if it makes sense to catch all exceptions and set uiimage = null;.
What kind of error did you run into that crashed your app?
I wanted to catch error from LoadAsync which is called by SetImage.
Since then, I found out I can do ExportImageSourceHandler and then implement my own LoadAsync.
Should be fixed on 2.3.6-pre1
Can you please help me for verifying the fix being applied in above bug. Any Steps to reproduce the bug would be great.
Thanks in advance.
(In reply to Neha Kharbade from comment #5)
> Hi Rui,
> Can you please help me for verifying the fix being applied in above bug. Any
> Steps to reproduce the bug would be great.
> Thanks in advance.
If you run the ControlGallery application, you can look at the test for issue 51173 and verify it using the instructions there.
Verified on xamarin.form version 220.127.116.116-pre6.
I downloaded Xamarin.form master sample and run ControlGallery on android, iOS and UWP app. And followed the instruction given for test B51173.
ScreenCast link : https://www.screencast.com/t/2GrP9QXLio