Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: How to force a refresh of an entire view/all fields

$
0
0
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:
  • 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).
Do I have to add a method something like RefreshAllData() which explicitly calls RaisePropertyChanged on all properties?

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.

Viewing all articles
Browse latest Browse all 1878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>