Lets say there is a Person class that holds some attributes and some other classes Address etc. (I am just giving an example of class{class{data}})
An instance of this is deserialized and loaded in the ui. The used might change the data (the name, the address or something).
If the instance is the datasource in the ui(in every control), how can I know if the data has been changed in order to notify the user to Save before exit?
You should implement the
INotifyPropertyChangedinterface, which basically exposes an event thatPersonshould raise when a property changes.The linked documentation gives an example with a
DemoCustomerclass which is likely to translate pretty easily into yourPersonclass.