locked
Datacontext Changed? RRS feed

  • Question

  • I have several bound controls to a custom object and all that works fine.  What I would like to have is anytime a change is made to any bound control I would like to able to fire an event to handle so additional logic.  Instead of handling each individual controls 'value' change event I was hoping that there was a more cleaner solution.  I tried looking into the datacontext, but it appears it doesn't support an event like this.

    Thanks in advance,
    Mike
    Wednesday, November 5, 2008 10:59 PM

Answers

  • To do that your custom object should implement INotifyPropertyChanged. You can attach that event. Apart from that you can use the DataContectChanged event to detect when the instance of the custom object changed.
    • Marked as answer by Marco Zhou Monday, November 10, 2008 6:35 AM
    Thursday, November 6, 2008 3:02 PM