At this point, the FloatingUIContainers cannot be selected. Implement selection to enable the users to work easily with such elements.
When pressing Shift+Up(Down) should create a selection to the start(end) of the document when the caret position is on the first(last) line. Currently, in this case, a selection is not created.
Such behavior can be achieved using the following approach:
private void RadRichTextBox_CommandExecuting(object sender, CommandExecutingEventArgs e)
{
if (e.Command is MoveCaretCommand && System.Windows.Input.Keyboard.Modifiers == ModifierKeys.Shift)
{
var command = e.Command as MoveCaretCommand;
MoveCaretDirections direction = (MoveCaretDirections)e.CommandParameter;
if (direction == MoveCaretDirections.Up)
{
var positionOnFirstLine = new DocumentPosition(this.radRichTextBox.Document);
positionOnFirstLine.MoveToFirstPositionInDocument();
if (this.radRichTextBox.Document.CaretPosition.Location.Y - positionOnFirstLine.Location.Y < 1)
{
this.radRichTextBox.Document.CaretPosition.MoveToPosition(positionOnFirstLine);
e.Cancel = true;
}
}
else if (direction == MoveCaretDirections.Down)
{
var positionOnLastLine = new DocumentPosition(this.radRichTextBox.Document);
positionOnLastLine.MoveToLastPositionInDocument();
if (positionOnLastLine.Location.Y - this.radRichTextBox.Document.CaretPosition.Location.Y < 1)
{
this.radRichTextBox.Document.CaretPosition.MoveToPosition(positionOnLastLine);
e.Cancel = true;
}
}
}
}
API ideas: - DocumentSelection: Get inlines between annotation start and end, e.g. DocumentSelection.EnumerateChildrenOfType<>(bool includePartiallySelectedElements) where T : DocumentElement - DocumentSelection: SelectAnnotationRange(AnnotationRangeStart start, bool includeAnnotation). Such method is present without the last parameter, but it always selects the annotation ranges
Steps to reproduce: 1. Insert a table into the document with borders enabled 2. Zoom out so the zoom level is below 100% Expected behavior: The borders are always rendered at a minimum of 1px width, even if the calculated size is below 1 at the current zoom level (This is what Word does) Actual behavior: Some of the borders do not render.
Seems that the algorithm is not showing the appropriate results when a word has apostrophe. For example typing "etre" does not suggest "ĂȘtre". A custom third-party spell checker library - NHunspell can be used. SDK Example demonstrating this approach can be found in our XAML-SDK portal: https://github.com/telerik/xaml-sdk/tree/master/RichTextBox/NHunspellSpellChecking
In MS Word, when track changes are enabled, the users can choose to show the revisions in balloons, similar to comments. Add such possibility in RadRichTextBox as well.
The properties applied locally to the content are not preserved and used for the new content when the user changes the paragraph indent.
Workaround: Keep the properties in a variable and apply them after executing the command:
StyleDefinition style;
private void RadRichTextBox_CommandExecuted(object sender, CommandExecutedEventArgs e)
{
if (e.Command is IncrementParagraphLeftIndentCommand)
{
this.radRichTextBox.CurrentEditingStyle.CopyPropertiesFrom(style);
}
}
private void RadRichTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
if (e.Command is IncrementParagraphLeftIndentCommand)
{
style = new StyleDefinition(this.radRichTextBox.CurrentEditingStyle);
}
}
private void RadRichTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e){ if (e.Command is PasteCommand && this.radRichTextBox.Document.IsEmpty) { this.radRichTextBox.Insert(" "); }}htmlProvider.ExportSettings.StylesExportMode = StylesExportMode.Inline;htmlProvider.ExportSettings.StylesExportMode = StylesExportMode.Classes;