Finally with a FlowDocumentScrollViewer an the XmlToXamlConverter I get the solution:
<FlowDocumentScrollViewer
Document="{Binding Content, Converter={StaticResource HtmlToFlowDocConverter}}"/>
After we need to add a Converter like:
public object Convert(object value, Type targetType, object parameter,
CultureInfo culture)
{
var xaml = HtmlToXamlConverter.ConvertHtmlToXaml((string)value, true);
var flowDocument = XamlReader.Parse(xaml);
if (flowDocument is FlowDocument)
SubscribeToAllHyperlinks((FlowDocument)flowDocument);
return flowDocument;
}
private void SubscribeToAllHyperlinks(FlowDocument flowDocument)
{
var hyperlinks = GetVisuals(flowDocument).OfType<Hyperlink>();
foreach (var link in hyperlinks)
link.RequestNavigate += LinkRequestNavigate;
}
private static IEnumerable<DependencyObject> GetVisuals(DependencyObject root)
{
foreach (var child in
LogicalTreeHelper.GetChildren(root).OfType<DependencyObject>())
{
yield return child;
foreach (var descendants in GetVisuals(child))
yield return descendants;
}
}
private void LinkRequestNavigate(object sender,
System.Windows.Navigation.RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
public object ConvertBack(object value, Type targetType, object parameter,
CultureInfo culture)
{
throw new NotImplementedException();
}
}
Finally we will add the XmlToXamlConverter from here and another from here.
Another helpfull article for me was this.
Greetings!