I would like to differentiate between changing the text programmatically (for example in a button click handler event) and user input (typing, cutting and pasting text). <
If you just want to use the built-in WPF TextBox, then I don't believe it's possible.
There is a similar discussion on the Silverlight forums here: http://forums.silverlight.net/p/119128/268453.aspx It's not exactly the same question, but I think the idea similar to that in the original post might do the trick for you. Have a SetText method on a subclassed TextBox, that set a flag before changing the text and then set it back after. You could then check for the flag inside the TextChanged event. This would of course require all of your programmatic text changes to use that method, but if you have enough control over the project to mandate that I think it would work.