void UpdateTextHtml() { string text = Element.Text ?? string.Empty; #if __MOBILE__ var attr = new NSAttributedStringDocumentAttributes { DocumentType = NSDocumentType.HTML }; NSError nsError = null; Control.AttributedText = new NSAttributedString(text, attr, ref nsError); #else var attr = new NSAttributedStringDocumentAttributes { DocumentType = NSDocumentType.HTML }; var htmlData = new NSMutableData(); htmlData.SetData(text); Control.AttributedStringValue = new NSAttributedString(htmlData, attr, out _); #endif _perfectSizeValid = false; }
void UpdateTextHtml() { if (IsElementOrControlEmpty) { return; } string text = Element.Text ?? string.Empty; var attr = GetNSAttributedStringDocumentAttributes(); #if __MOBILE__ NSError nsError = null; Control.AttributedText = new NSAttributedString(text, attr, ref nsError); #else var htmlData = new NSMutableData(); htmlData.SetData(text); Control.AttributedStringValue = new NSAttributedString(htmlData, attr, out _); #endif _perfectSizeValid = false; // Setting AttributedText will reset style-related properties, so we'll need to update them again UpdateTextColor(); UpdateFont(); }
void UpdateTextHtml() { if (IsElementOrControlEmpty) { return; } string text = Element.Text ?? string.Empty; var attr = GetNSAttributedStringDocumentAttributes(); #if __MOBILE__ NSError nsError = null; Control.AttributedText = new NSAttributedString(text, attr, ref nsError); #else var htmlData = new NSMutableData(); htmlData.SetData(text); Control.AttributedStringValue = new NSAttributedString(htmlData, attr, out _); #endif _perfectSizeValid = false; }