You work as an Application Developer for ABC. The company uses Visual Studio .NET Framework 3.5 as its application development platform. You are working on enhancements to an existing WPF application. One problem you have been encountering is that users of the current version routinely enter invalid data, and since the controls use data binding, that data either gets put in the database incorrectly, or in some cases generates a database error. You want to incorporate validation with your data bound controls. Which of the following choices is the best way to accomplish this goal?
A. Use the default error template and implement it when binding the individual controls to the data source.
B. Assign validator controls to each control you wish to validate, and incorporate those in the binding of that control to the data source.
C. Use a custom error template and implement it when binding the individual controls to the data source.
D. Assign validator controls to each control you wish to validate, and set the validation properties to indicate what constitutes valid data.
Answer:C
You work as an Application Developer for ABC. The company uses Visual Studio .NET Framework 3.5 as its application development platform. You are working on enhancements to an existing WPF application. One problem you have been encountering is that users of the current version routinely enter invalid data, and since the controls use data binding, that data either gets put in the database incorrectly, or in some cases generates a database error. You want to incorporate validation with your data bound controls. Which of the following choices is the best way to accomplish this goal?
A. Use the default error template and implement it when binding the individual controls to the data source. B. Assign validator controls to each control you wish to validate, and incorporate those in the binding of that control to the data source. C. Use a custom error template and implement it when binding the individual controls to the data source. D. Assign validator controls to each control you wish to validate, and set the validation properties to indicate what constitutes valid data.