Try
Device.BeginInvokeOnMainThread (async() => {
await Navigation.PushAsync...
});
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hey!
I have a page with a barcode scanner in which another page is opened when a scan is completed. I use Navigation.PushAsync, which works everywhere in the app, but somehow it doesn't work here and throws the exception "Only the original thread that created a view hierarchy can touch its views". I have no idea how to fix this, so hopefully someone is able to help.
The interface:
Getting the scanned result and redirecting to the page (simplified):
Opening the page (simplified):
The error occurs at line 127. I hope someone can help!
Try
Device.BeginInvokeOnMainThread (async() => {
await Navigation.PushAsync...
});