I have a textbox that has text bound:
<TextBox x:Name="textBox" Text="{Binding SomeText}" />
Is there a way to change the text from code in a way so that it is undoable.
Only way I can think of is ClipBoard and textBox.Paste() but don't want to alter clipboard in case user has something there.
It is for a control that looks like this:
The buttons changes the text and I want it to be undoable.
This works for me:
xaml:
in the code-behind:
When using it, set the TextToSet property to whatever the button click should provide.