Hi,
is there a way to Highlight a single Token in the XamSyntaxEditor?
I have to perform a Min- Max-Limit check for a Token where the Limits are only known after starting the Program. Thus I am looking for a way to find all Tokens I need to check and Highlight them (overriding the Language style) if they are out of bounds.
The best would be if I could somehow use the Syntaxerror reporting.
Thus far I was able to find the Tokens and check the values, but I don't know how to Highlight them to show the User that he has entered a not valid value.
Regards
Thomas Stüven
Hello Thomas,
There currently does not exist a way to highlight a single token in the XamSyntaxEditor control that I am personally aware of. I am currently checking with our senior development staff to be certain, but I believe that the text placed in the editor pulls its color purely from the Language style supported by the ClassificationAppearanceMap in this case.
While I don't entirely understand your scenario in this case, I have to wonder if a XamSyntaxEditor is really your best bet here, or whether you would want something more along the lines of a XamRichTextEditor, as this would allow you to highlight a particular "node." You can read further about the XamRichTextEditor at the following online documentation article: https://es.infragistics.com/help/wpf/xamrichtexteditor.
If you would like to see single-node highlighting added to the XamSyntaxEditor control, I would recommend suggesting a new product idea for this feature at http://ideas.infragistics.com. This product ideas site places you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Hi Andrew,
thank you for the quick response.
I'm using the XamSyntaxEditor because we need the Syntax Highlighting. For this I use a custom Language build from an EBNF File.
Also I don't want to set the Highlight for the Token directly in the Editor as that would break the MVVM Pattern. I actually trying to do that thru the TextDocument in the ViewModel. I'm sorry for not being clear enough on this.
SincerelyThomas