convertToHtml (xaml);
xaml. XAML string.
The convertToHtml method converts an XAML string to HTML.
To execute the example, add a link to PP.js libraries to HTML page. Convert an HTML string to XAML and back:
conv = new PP.HtmlXamlConverter(); //create an instance of the HtmlXamlConverter class xaml = conv.convertToXaml("");//get XAML string from HTML html = conv.convertToHtml(xaml);////get HTML string from XAML console.log("XAML: " + xaml + "\n HTML: " + html);//output XAML and HTML strings to the console
After executing the example the console shows the following:
XAML: <?xml version='1.0' encoding='utf-16'?><TextBlock xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:s='clr-namespace:System;assembly=mscorlib' >Title</TextBlock>
HTML: <div style='height: auto; ' >Title</div>
See also: