I was adding some workaround code to fix the bug outlined in Is this a bug in DotNet 4 WPF Spell Checking?, (When a WPF TextBox changes Enabled,
Visible
or ReadOnly
states, any SpellCheck custom dictionaries get dropped off until you disable and re-enable SpellCheck) and the simplest fix seemed to be to handle the IsVisibleChanged
, IsEnabledChanged
, and IsReadOnlyChanged
events.
Simple, right? Except there is no IsReadOnlyChanged
event. Anybody know why and what the best way to trap a change to IsReadOnly
in a WPF TextBox would be?
You can always follow dependency property change with DependencyPropertyDescriptor.AddValueChanged
Create a custom class and handle OnPropertyChanged event. Sth like this: