The scenario:
We have a document with text inside and we are executing the following steps:
Observed: Before releasing the mouse button the cursor position is correct but after releasing it the cursor position is changed to the initial selection end.
DeleteAnnotationRange fails to execute when the content is uneditable annotation. For example: PermissionRange with a checkbox content control inside.
A possible workaround would be to manually delete the annotation range from the document element tree:
var rangeEnd = rangeStart.End;
var endParent = rangeEnd.Parent;
if (endParent != null)
{
endParent.Children.Remove(rangeEnd);
}
var parent = rangeStart.Parent;
if (parent != null)
{
parent.Children.Remove(rangeStart);
}
this.radRichTextBox.UpdateEditorLayout();
A user reported a significant performance impact with the RichTextBox in our recent update. The UI hangs repeatedly while typing.
Profiling showed a lot of garbage collections, and profiling highlighted the the Telerik class Telerik.Windows.Controls.MarkupExtensions.DocumentsResourceProvider.
#if NETCORE
private static Style ThemeStyle
{
get
{
if (themeStyle == null)
{
themeStyle = GetStyleFromApplicationTheme();
}
return themeStyle;
}
}
private static Style GetStyleFromApplicationTheme()
{
if (StyleManager.IsEnabled && StyleManager.ApplicationTheme != null)
{
var themeName = StyleManager.ApplicationTheme.GetType().Name.Trim('_').ToLower();
themeName = themeName.Replace("theme", string.Empty);
var themesGeneric = Application.LoadComponent(new Uri("/Telerik.Windows.Controls.RichTextBox;component/themes/generic.xaml", UriKind.Relative)) as ResourceDictionary;
if (themesGeneric != null)
{
var currentThemeDictionary = themesGeneric.MergedDictionaries.FirstOrDefault(rd => rd.Source != null && rd.Source.OriginalString.ToLower().Contains(themeName));
if (currentThemeDictionary != null)
{
return currentThemeDictionary[typeof(DocumentsResourceProvider)] as Style;
}
}
}
return null;
}
I copied this code into my project to debug it, and found:
As the method returns null, it means themeStyle is always null, and it will try again on the next caller. This code is called repeatedly while typing. Using my code (and reflection) to force this ThemeStyle to Fluent fixes the performance, though obviously is a huge workaround.
When ScaleFactor is set to less that (1,1), this causes the caret to disappear at specific positions in the document. These positions depend on the exact value of the scale factor. The focus is still in the editor and users can type. Note that if the scale factor changes, the positions where the caret is not visualized will change as well.
Add support for line numbering in paged layout mode, similar to MS Word.