title: Hybrid WebView Navigating and navigated event Xamarin Form
body: <p>I am developing a Cross-platform app in c# using xamarin forms. I have created a cross-platform PCL project. I have implemented Hybrid Web View in it. As I am trying to load my html content in it. I just want to know how to capture the hybrid webview's navigated and navigating event. I am very new to Xamarin and native mobile development.</p>
  
  <p>I want to get OnNavigating and OnNavigated events in hybrid web view for all platforms Android, iOS, UWP, WinPhone.</p>
  
  <p>mainpage.xaml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               xmlns:local="clr-namespace:Demo;assembly=Demo"
               x:Class="Demo.MainPage"
               Title="Dashboard"&gt;
    &lt;ContentPage.Content&gt;
      &lt;local:HybridWebView x:Name="hybridWebView"  Uri="local.html" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" /&gt;
    &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>MainPage.xaml.cs</p>
  
  <pre><code>public UserDashboard()
          {
              InitializeComponent(); 
          }
  </code></pre>
  
  <p>HybridwebViewRendered.cs for Android</p>
  
  <pre><code>[assembly: ExportRenderer(typeof(HybridWebView), typeof(HybridWebViewRenderer))]
  namespace FISE.Droid
  {
      public class HybridWebViewRenderer : ViewRenderer&lt;HybridWebView, Android.Webkit.WebView&gt;
      {
          const string JavaScriptFunction = "function invokeCSharpAction(data){jsBridge.invokeAction(data);}";
  
          protected override void OnElementChanged(ElementChangedEventArgs&lt;HybridWebView&gt; e)
          {
              base.OnElementChanged(e);
              Android.Webkit.WebView.SetWebContentsDebuggingEnabled(true);
  
              if (Control == null)
              {
                  var webView = new Android.Webkit.WebView(Forms.Context);
                  webView.Settings.JavaScriptEnabled = true;
                  webView.Settings.DomStorageEnabled = true;
                  Android.Webkit.WebView.SetWebContentsDebuggingEnabled(true);
                  webView.SetWebChromeClient(new WebChromeClient());
                  webView.SetWebViewClient(new WebViewClient());
                  SetNativeControl(webView);
              }
              if (e.OldElement != null)
              {
                  Control.RemoveJavascriptInterface("jsBridge");
                  var hybridWebView = e.OldElement as HybridWebView;
                  hybridWebView.Cleanup();
              }
              if (e.NewElement != null)
              {
                  Control.AddJavascriptInterface(new JSBridge(this), "jsBridge");
                  Control.LoadUrl(string.Format("file:///android_asset/Content/{0}", Element.Uri));
                  InjectJS(JavaScriptFunction);
              }
          }
  
          void InjectJS(string script)
          {
              if (Control != null)
              {
                  Control.LoadUrl(string.Format("javascript: {0}", script));
              }
          }
  
      }
  }
  </code></pre>
  
  <p>And I am unable to debug my Html pages inside hybrid webview. How can I do it?
  My hybrid webview's height is not setting to 100%. The html pages inside web view are neglecting height:100% property. How can set hybrid webview's height to fit screen size?</p>