I am setting up cross platform app using xamarin forms, I have used this guide to use a hybrid webview, the purpose of this is to use openlayers maps, so, I can select markers, and return those markers to view and load list of those markers into a new view.
This is the guide I am using
Javascript function is return markers information correctly to View.
The problem is code below:
hybridWebView.RegisterAction (data => DisplayAlert ("Alert", "Hello " + data, "OK"));
//I have changed this into this method, and created new function LoadSelectedLeads
hybridWebView.RegisterAction(data => LoadSelectedLeads(data));
// I have used this await or without await too, both didn't work
public async void LoadSelectedLeads(String data)
{
await Navigation.PushAsync(new NavigationPage(new SelectedLeads()));
}
The only issue I am facing its not loading the SelectedLeads()
at all, it shows error this
"only the original thread that created a view hierarchy can touch its views xamarin forms"