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

New Post: View to ViewModel Model Data Validation with no ICommands

$
0
0
Hi,

Based on my understanding of your scenario, to implement Data Validation without using ICommands, you could implement one of the following approaches:

  • Implement IDataErrorInfo on your Model class and bind to its properties directly from your View or fire an event to tell the ViewModel that a Data Validation error ocurred and update the View accordingly.
  • Use Event Triggers on your View and define a method on your ViewModel to handle this event and do the Data Validation. This way, you can make the ViewModel to do Data Validation when an event from the Items of your ItemsControl is raised, like GotFocus and LostFocus.
For more information about IDataErrorInfo or Triggers, you can visit the following sections of the documentation:

Hope this helps,

Federico Martinez
http://blogs.southworks.net/fmartinez

Viewing all articles
Browse latest Browse all 1878

Trending Articles



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