I have a list of models displayed in a listview when the listviewitem is clicked I open a dialog that is bound to the listviewitem's data model and allows the user to edit the various properties.
I am trying to figure how to deal with the ok and cancel buttons. On the one hand if I bind the dialog directly to the listviewitem's model there doesn't seem to be a way to cancel the operation.
If on the other hand I give the dialog a clone (not so hip on this because of the overhead of making my model cloneable) of the model instead of the real one cancel is easy to handle but getting the new data into existing model is pain because then I have to go through and copy all the properties from the clone back into the original model.
I suspect there a good design pattern for this. Any ideas?