title: Displaying HTML in WPF using MVVM
body: <p>I have HTML-Source string saved in SQL Server table called "Report" in  HTMLReport field (field type is NTEXT). Now I need to display that stored HTML 
  into WPF Window. HTML tags and inline-CSS need to be interpreted on this WPF Window.</p>
  
  <p>Can someone help me to complete this code? </p>
  
  <h2>HTMLView.xaml</h2>
  
  <pre><code>  &lt;Window x:Class="MyProject.HTMLView"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
      Title="HTML View" Height="454" Width="787"
      &gt;
    &lt;Grid Name="grid1"&gt;
      &lt;WindowsFormsHost&gt;
  
      &lt;wf:RichTextBox x:Name="reportHTML" Text="{Binding DisplayHTML, Mode=OneWay}"/&gt;
  
         &lt;!-- How do i bind dispaly HTML page here--&gt;
  
      &lt;/WindowsFormsHost&gt;
    &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <h2>HTMLViewModel.cs</h2>
  
  <pre><code>  namespace MyProject
    {
      public class HTMLViewModel: ViewModelBase
      {
        public HTMLViewModel()
        {
              //Reading from SQL Server table 
              //SELECT HTMLReport FROM Report WHERE ID=123
              //OK, I have HTMLString from database over here
              //Now I am assigning that to DisplayHTML Property
  
             DisplayHTML ="&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;This text should be in table with bold fond &lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;";
        }
  
        private string _displayHTML;
        public string DisplayHTML
        {
          get
          {
              return _displayHTML;
          }
  
          set
          {
              if (_displayHTML!= value)
              {
                  _displayHTML= value;
                  OnPropertyChanged("DisplayHTML");
              }
          }
      }
    }
  </code></pre>