/// <summary> /// Changes the current word with the specified suggestion. /// </summary> /// <param name="suggestion"> /// The suggestion. /// </param> public override void ChangeCurrentWord(string suggestion) { var radRichTextBox = (RadRichTextBox)CurrentControl; var inlineLayoutBox = radRichTextBox.Document.Selection.GetSelectedBoxes().FirstOrDefault(s => s.AssociatedDocumentElement is Span); Span span; if (inlineLayoutBox != null) { span = new Span((Span)inlineLayoutBox.AssociatedDocumentElement); } else { span = new Span(); span.CopyPropertiesFromStyle(radRichTextBox.CurrentEditingStyle); } span.Text = suggestion; radRichTextBox.InsertInline(span); }