2. Mahender Sarangam Having 5 years of experience on .NET Technologies. Working as a Senior Software Engineer in United Health Group (UHG India Information Service Ltd.). Worked with Big Firms like Deloitte Consulting & Wipro Technology. Got Technical Acquaintance on Technologies like C#, ASP.NET,AJAX, LINQ, Silverlight, WPF,WCF ,SQL Server, Team Foundation Server(TFS) and SharePoint Technology. MCTS Certified in Web Technologies. Blog : http://Msarangam.wordpress.com
3.
4. Property setter exception: For example, a property like UnitCost may use a range check and throw an exception if you attempt to set a negative number.
5.
6. To enable the BindingValidationFailed event, you must set ValidatesOnExceptionsto true (to detect errors) and NotifyOnValidationError to true (to fire the validation events). Whenever NotifyOnValidationError is true, BindingValidationError is fired and its bubble event,which can be handled in parent elements. For example : <TextBoxMargin="5" Grid.Row="2" Grid.Column="1" x:Name="txtUnitCost” Text="{Binding UnitCost, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"></TextBox>
7. Steps for Data Object Validation There are three basic steps to follow Implement the IDataErrorInfo or INotifyDataErrorInfo interface in your data object. Tell the data binding infrastructure to check the data object for errors and show error notifications. If you’re using the IDataErrorInfo interface, you set ValidatesOnDataErrors to true. If you’re using the INotifyDataErrorInfo interface, you set ValidatesOnNotifyDataErrorsto true Optionally, set NotifyOnValidationError to true if you want to receive the BindingValidationFailedevent. Optionally, set the ValidatesOnExceptions property to true if you want to catch other types of errors, such as data conversion problems. private <string, <string>> errors = new <string, List<string>>(); public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged;