PP.HtmlXamlConverter.textToXaml (text, isHyperlink, dims, style);
text. Text.
isHyperlink. Specified if to create XAML string as a hyperlink.
dims. Dimensions array.
style. CSS style.
ThetextToXaml method converts text to XAML.
To execute the example, add a link to PP.js libraries to HTML page. Convert text to XAML string:
console.log(PP.HtmlXamlConverter.textToXaml("text"));
After executing the example converted XAML string is shown in the browser console:
<?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' FontFamily='Tahoma' FontWeight='Bold' FontStyle='Normal' TextAlignment='Left' ><Run xml:space='preserve' >text</Run></TextBlock>
See also: