TextBox.TextChanged & ICommandSource

Posted by Brad Leach on Stack Overflow See other posts from Stack Overflow or by Brad Leach
Published on 2008-09-11T05:36:17Z Indexed on 2010/04/20 1:43 UTC
Read the original article Hit count: 307

Filed under:

I am following the M-V-VM pattern for my WPF UI. I would like to hook up a command to the TextChanged event of a TextBox to a command that is in my ViewModel class. The only way I can conceive of completing this task is to inherit from the TextBox control, and implement ICommandSource. I can then instruct the command to be fired from the TextChanged event. This seems to be too much work for something which appears to be so simple.

Is there an easier way (than subclassing the TextBox and implementing ICommandSource) to hook up the TextChanged event to my ViewModel class?

© Stack Overflow or respective owner

Related posts about wpf