Forum Xamarin.Forms

HybidWebView for two way communication from C# to JS and vice versa

SurbhiAroraaSurbhiAroraa Member ✭✭✭

How to achieve both way communication in WebView with single control i.e. to call C# function from Javascript and call Javascript function from C#. Any leads will be appreciated much. @JamesMontemagno


  • Suriya_KalidossSuriya_Kalidoss Member ✭✭✭

    Hi @SurbhiArora
    JavaScript code in webview
    function playAudio() {; } function pauseAudio() { wavesurfer.pause(); }
    c# code to call js code here Waveform refers webview page
    `private static void IsPlayPropertyChanged(BindableObject bindable, object oldValue, object newValue)
    if ((bool)newValue)


    <?xml version="1.0" encoding="UTF-8"?> <Grid xmlns="" xmlns:x="" x:Class="Controls.Waveform" > <WebView x:Name="webview"></WebView> </Grid>

Sign In or Register to comment.