Localize the tooltips for the match case button, the match word button and the use regular expression button.
Currently, the tooltips of the buttons are using hardcoded strings in English.
To translate the tooltips, you can get the corresponding buttons on load of the syntax editor control and replace their tooltips manually.
private void syntaxEditor_Loaded(object sender, RoutedEventArgs e)
{
var buttons = this.syntaxEditor.ChildrenOfType<RadToggleButton>();
var matchCaseButton = buttons.FirstOrDefault(x => x.Name == "PART_MatchCaseButton");
var matchWordButton = buttons.FirstOrDefault(x => x.Name == "PART_MatchWordButton");
var useRegularExpressionsButton = buttons.FirstOrDefault(x => x.Name == "PART_UseRegularExpressionsButton");
matchCaseButton.ToolTip = CreateToolTip("SyntaxEditor_MatchCase"); // these are custom localization resource keys that should be manually defined by the developer that uses this solution
matchWordButton.ToolTip = CreateToolTip("SyntaxEditor_MatchWord");
useRegularExpressionsButton.ToolTip = CreateToolTip("SyntaxEditor_UseRegularExpressions");
}
private static ToolTip CreateToolTip(string resourceKey)
{
var toolTip = new ToolTip();
toolTip.Content = LocalizationManager.Manager.GetStringOverride(resourceKey);
return toolTip;
}
If you have an XML attribute with a string value, but the value is not fully rendered into the viewport, its color defaults to black, instead of the expected blue color.
To work this around, you can create a custom XmlTagger and override its GetTags() method. This will allow you to properly catch the string value and return it as a tag span element with its ClassificationType set to "string".
When the control is inside ScrollViewer and you click it, focus is lost and caret disappears. Some controls have built in ScrollViewer , for example LayoutControl so placing the editor in LayoutControl also leads to the same issue.
Generally placing the syntaxeditor in scrollviewer is risky for the vertical virtualization so at least a height should be set to the control. In R2 2020 SP, an exception will be thrown if Syntax Editor with no height is added in scroll viewer or stack panel or other panel which measures vertically with infinity.
Workaround for this issue:
private void syntaxEditor_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)In some scenarios, an ArgumentException is thrown when a folding region with selected text is collapsed. An example can be seen below:
After putting a folding region out of the viewport by scrolling and then bringing it back, the folding region is not drawn correctly when typing new lines into it.
/* and */ words are start /end words for multiline comments in C#/SQL/VB
They should be outside strings when they form a comment block.
//using System;
//usign System.Windows.Controls;
Two consecutive lines with commented using sections result in ArgumentOutOfRangeException in SyntaxEditor with CSharpFoldingTagger.
Shift + Alt + Down Selection then typing multiple characters results in all of them being typed in all selected lines.
Shift + Alt _ Down Selection then typing multiple characters results in only the first one being typed in all lines, then selection is lost and next chars are inserted in the last selected line only.
Default keystroke in other editors to activate text replacement is: ctrl+H
Would be nive to enable this in the syntax editor.