I am using the PropertyGrid and a derivation of an Int32PropertyEditor. The only things I do in my derivation are set the Minimum to 0 (so it's positive numbers only) and force the SpinnerVisibility to Visible. Then I use the [Editor] attribute on my model classes to allow the PropertyGrid to build itself.
The model properties look something like this:
[DisplayName("LG Columns")]
[Description("The number of columns the control will occupy when the viewport is large")]
[Editor(typeof(PositiveInt32EditorWithSpinner), typeof(PropertyEditor))]
public int LargeColumns { get; set; }
I have my ViewModels handling property changes through your PropertyGrid's PropertyValueChanging and PropertyValueChanged events. The problem arrises when I make changes to the integer values using the spinner and then press Ctrl+Z to Undo or Ctrl-Y to Redo. When the TextBox portion of the editor has focus it performs the Undo/Redo locally just on the EditBox and the Undo or Redo event does not bubble up to my application's MainWindow so that I can handle it. These events swallowed by the TextBox and the PropertyGrid's PropertyValueChanging and PropertyValueChanged do not fire. Everything is fine if the TextBox portion of the editor does not have focus.
Any solution to this?