Forum General

How can I transform method into an event?

jaYCee.1750jaYCee.1750 USMember ✭✭

Can anyone lend a help please? I'm really having trouble with this one... How do I make this method into an event?


void IScanSuccessCallback.barcodeDetected(MWResult result)
        if (result != null)
                var scan = Element as BarcodeScannerModal;

                if (scan == null)
            catch (Exception ex)

And pass the value of result into another class, specifically in here:


public async Task<object[]> GetResult()
        TaskCompletionSource<object[]> tcs = new TaskCompletionSource<object[]>();
        scanPage.OnScanResult += async (result) =>
            object[] scanResult = new object[2];
            scanResult[0] = resultFinal.text;
            scanResult[1] = resultFinal.typeText;
            await PopupNavigation.PopAsync();

        return await tcs.Task;

Please, I really need your help. :-( If you ever wonder what type of Barcode Scanner I am using, it's Manatee Works Barcode Scanner.

Sign In or Register to comment.