I have created a HybridWebView according to https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/custom-renderer/hybridwebview/ and created a native ios WKWebView. Now I want to add custom controls to go Back/Forward/Home in Forms but I am not sure what is the recommended way to make a call from my Xamarin forms view into my native view to for example trigger the GoBack() of the ios WKWebView browser?
Should I try to call into my native implementation or should the native view listen to events from the forms view?
public HybridWebViewRenderer() { MessagingCenter.Subscribe<HybridWebView>(this, MessageTypes.BrowserBackButtonClick.ToString(), GoBack); }
And my methods look like this:private void GoBack(HybridWebView sender) { if (Control.CanGoBack) Control.GoBack(); }
...sorry for the code formatting here, can't seem to get these snippets to look nice. – Mårten