Search
ShapeNode.EnableStyledText Property
See Also
 





Gets or sets a value indicating whether styled text rendering is enabled.

Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf

 Syntax

C#  Copy Code

public bool EnableStyledText { get; set; }

Visual Basic  Copy Code

Public Property EnableStyledText As Boolean

 Property Value

true to parse the node's text in order to find formatting tags; otherwise, false. Initialized with the value of EnableStyledText.

 Remarks

Styled text allows applying various attributes to the characters it contains. Attributes are specified using HTML-like formatting tags embedded in the raw text. Formatting tags are listed and described in the Text Attributes and Formatting section of this help file.

Styled text can be enabled only if PolygonalTextLayout is set to true. If enabled, Text is parsed and analyzed each time it is changed. Parsing determines what formatting tags are used and adds the corresponding attribute records to WpfDiagram's internal representation of styled text. If the property value is false, the text is not processed in any way and is displayed without formatting.

 Example

The following sample code demonstrates how to use styled text:

C#  Copy Code
shapeNode.PolygonalTextLayout = true;
shapeNode.EnableStyledText = true;
shapeNode.Text = "CH<sub>2</sub>CL<sub>2</sub>\n" +
    "<b><color=#0088FF>methylene-chloride</b>";
Visual Basic  Copy Code
shapeNode.PolygonalTextLayout = True
shapeNode.EnableStyledText = True
shapeNode.Text = "CH<sub>2</sub>CL<sub>2</sub> " + vbNewLine + _
    "<b><color=#0088FF>methylene-chloride</b>"

 See Also