Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Webview binding is not working

$
0
0

I have a webview that is bound to an HTML snippet
snippet:
<h1>Hello World!</h1>

<WebView>
    <WebView.Source>
        <HtmlWebViewSource Html="{Binding Html}" />
    </WebView.Source>
</WebView>

private string _html;
public string Html
{
    get { return _html; }
    set
    {
        if (_html == value) return;
        _html = value;
        OnPropertyChanged();
    }
}

this used to work in previous versions of Forms, with the latest 2 stable releases it crashes

String reference not set to an instance of a String. Parameter name: s

stacktrace:

at System.Text.Encoding.GetBytes(String s)
   at Xamarin.Forms.Platform.WinPhone.WebViewRenderer.<SaveToIsoStore>d__a.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Xamarin.Forms.Platform.WinPhone.WebViewRenderer.<LoadHtml>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__3(Object state)

any ideas how to fix this?


Viewing all articles
Browse latest Browse all 91519

Trending Articles