Dear Support,
I am using the SfRichTextBoxAdv control in an UWP app. When content is being added programmatically like this...
SpanAdv span = new SpanAdv { Text = "Here is some text." };ParagraphAdv paragraph = new ParagraphAdv();paragraph.Inlines.Add(span);RichTextBox.Document.Sections[0].Blocks.Add(paragraph);... I have found that the Undo/Redo commands don't work, even though I have Undo enabled...
RichTextBox.EditorSettings.IsUndoEnabled = true;I've tried calling the command directly, for example...
RichTextBox.UndoCommand.Execute(null);... and by binding the command to a button, and then clicking the button programmatically...
<Button x:Name="UndoButton" Content="Undo" Command="{Binding ElementName=Document, Path=UndoCommand, Mode=TwoWay}" />ButtonAutomationPeer peer = new ButtonAutomationPeer(UndoButton);IInvokeProvider invokeProv = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;invokeProv.Invoke();... but neither approach undoes edit operations.
However, Undo/Redo works when content gets typed into the editor, but this is of no use to me.
Is it possible to use these commands when text is being added programmatically, or is there maybe a setting I've missed?
I am using Essential Studio Version 18.1.0.42.
Thanks in advance!