How to detect if the text of a node was modified

Hi, I have a question, I want to know how I can detect if the text of a node was modified. There are any event?

Perhaps you are looking for the Diagram.TextEdited event?

But if i want to cancel the change of text, how I can do this?

e.Handled = true; => Dont work to me

Override TextEditingTool.IsValidText.

There are any example? Because I dont know how implement.

or any documentation about this, I cant find any

  public class CustomTextEditingTool : TextEditingTool {
    protected override bool IsValidText(string oldstring, string newstring) {
      return !newstring.Contains("e");
    }
  }

Install with:

    <go:Diagram . . .>
      <go:Diagram.TextEditingTool>
        <local:CustomTextEditingTool />
      </go:Diagram.TextEditingTool>
      . . .
    </go:Diagram>

I have the next problem, when the edit is cancel the user can not continue.

- YouTube.

I tried this:

    protected override bool IsValidText(string oldstring, string newstring) {
      bool valid = !newstring.Contains("e");
      if (!valid) {
        MessageBox.Show("Oops: new string contains 'e'");
      }
      return valid;
    }

When it showed the MessageBox, I could modify the text so that it did not contain the letter ā€˜eā€™, or I could hit ESCAPE to cancel the edit and restore the original text string.

The normal behavior is that clicking elsewhere in the diagram will cause the text editor to lose focus, which in turn does the text validation. If the validation is successful, the text is accepted; otherwise the user can continue to edit the text. That seems to be the situation in your video ā€“ you have programmed the text validation not to allow what the user entered, and it is indeed not allowing that text to be accepted.