WPF TextBox Intercepting RoutedUICommands

前端 未结 6 1330
自闭症患者
自闭症患者 2021-02-14 03:10

I am trying to get Undo/Redo keyboard shortcuts working in my WPF application (I have my own custom functionality implemented using the Command Pattern). It seems, however, tha

6条回答
  •  温柔的废话
    2021-02-14 03:42

    TextBoxBase (and thus TextBox and RichTextBox) have IsUndoEnabled property, defaulting to true. If you set it to false (and you can event do it for all textboxes on your window via a style and a setter, as usual), then they will not intercept Ctrl+Z.

提交回复
热议问题