title: How to Binding html to a WebView
body: <p>i was searching about how to binding html in webview and i found this:</p>
  
  <pre><code>public static class WebBrowserHelper
  {
  
  public static readonly DependencyProperty HtmlProperty = DependencyProperty.RegisterAttached(
      "Html", typeof(string), typeof(WebBrowserHelper), new PropertyMetadata(null, OnHtmlChanged));
  
  public static string GetHtml(DependencyObject dependencyObject)
  {
      return (string)dependencyObject.GetValue(HtmlProperty);
  }
  
  public static void SetHtml(DependencyObject dependencyObject, string value)
  {
      dependencyObject.SetValue(HtmlProperty, value);
  }
  
  private static void OnHtmlChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
  {
      var browser = d as WebView;
  
      if(browser == null)
          return;
  
      var html = e.NewValue.ToString();
  
      browser.NavigateToString(html);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and the xamls code should be that</p>
  
  <pre><code>&lt;WebView Grid.Column="1" Height="628" Margin="10,0" VerticalAlignment="Top" cxi:WebBrowserHelper.Html="{Binding Question.Body}" /&gt;
  </code></pre>
  
  <p>but i can't acces this property in xaml, am i doing something wrong?</p>