void Scan() { this.txtStatus.Text = "scanning for 30s"; ZXingQrCodeScanner.ScanFirstCameraForQrCode( result => { this.txtStatus.Text = "done, say 'reset' to reset"; this.txtResult.Text = result?.Text ?? "none"; }, TimeSpan.FromSeconds(30)); }
void Run() { this.txtResult.Text = "running forever"; ZXingQrCodeScanner.ScanFirstCameraForQrCode( result => { this.Dispatch(() => { this.txtResult.Text = $"Got result [{result}] at {DateTime.Now}"; }); }, null); }