Hi, I'm looking for a "best practices" pattern to use.
Scenario is:
Customer view is loaded, all bindings, saves and RaisePropertyChanged working correctly.
User changes a few fields, presses a cancel button.
I want to abort the changes and revert to the current data in the database.
When the user presses cancel I'm currently:
I have other patterns where pressing cancel closes the view so this is not an issue as the data is refreshed the next time the view is opened.
Scenario is:
Customer view is loaded, all bindings, saves and RaisePropertyChanged working correctly.
User changes a few fields, presses a cancel button.
I want to abort the changes and revert to the current data in the database.
When the user presses cancel I'm currently:
- Re-fetching the underlying object using a repository pattern. The customer model is then refreshed correctly with the values from the database.
- There is a reference to the customer model in in the viewModel.
-
Simply refreshing the customer model does not trigger RaisePropertyChanged on the individual properties (I don't expect it to at this point).
I have other patterns where pressing cancel closes the view so this is not an issue as the data is refreshed the next time the view is opened.