Articles in this section
Category / Section

How to apply the Format color for the same start and end text of lexem with nested format in EditControl?

1 min read

EditControl consider the Format based on Start and End text of lexem. It separates the codes by space. Nested lexem format color can be applied using its SubLexem property. Here we have considered the [::] as parent lexem and [:] as sub-lexem. The following code demonstrates the same.


Code Example: [Xaml]


<syncfusion:FormatsCollection x:Key="formats">
<!—Set Format Color -->
<syncfusion:EditFormats Foreground="Red" FormatName="FieldsFormat"/>
<syncfusion:EditFormats Foreground="Yellow" FormatName="StringFormat"/>
<!--Field Syntax-->
<syncfusion:Lexem IsMultiline="False" ContainsEndText="False" ParentLexemType="Literals" StartText="::" EndText="::" LexemType="Literals" FormatName="FieldsFormat" />
<syncfusion:Lexem IsMultiline="False" ContainsEndText="False" ParentLexemType="Literals" StartText=":" EndText=":" LexemType="Literals" FormatName="StringFormat" />
<!—For nested lexem-->
<syncfusion:Lexem ContainsEndText="True" IsMultiline="True"  StartText="::" IsRegex="true" EndText="::" LexemType="Literals" FormatName="FieldsFormat">
<syncfusion:Lexem ContainsEndText="False" IsMultiline="False"  StartText=":"  IsRegex="True"  LexemType="Literals" FormatName="StringFormat" />






Sample:  EditControlSample

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment