Undo/Redo Support for Table Changes in WPF RichTextBox

Posted by Jeff on Stack Overflow See other posts from Stack Overflow or by Jeff
Published on 2010-05-25T19:00:31Z Indexed on 2010/06/01 3:53 UTC
Read the original article Hit count: 288

Filed under:
|

As part of an editor project, I need to add functionality to the WPF RichTextBox control to allow the user to perform operations on a table. One of those operations is to apply a new width value to one or more columns of the table. I have a function that is applying a new Width value to the TableColumn objects in question, and the table is resizing itself nicely. However, I've noticed that the column-width change operation does not seem to be added to the undo stack.

In other words, if a user types something, then changes a column width, then selects undo, the RichTextBox control undoes the user's typing. Undo and redo don't seem to be picking up the property change on the TableColumn object.

Is there some way to make this operation occur in a way that it actually is undoable/redoable?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about richtextbox