Validation in WPF
I googled a lot but not getting how to do validation in WPF.
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Jan 13, 2015, 1:37 AM EST
Hi swapnil mukewar,
Go through following links it will help you
http://www.codeproject.com/Tips/690130/Simple-Validation-in-WPF
http://www.c-sharpcorner.com/UploadFile/fd59f5/data-validations-in-wpf/
http://blog.magnusmontin.net/2013/08/26/data-validation-in-wpf/
Munesh SharmaRank #174 · 13.9K reputationPosted Jan 13, 2015, 1:58 AM EST
Pradeep ShetRank #595 · 4K reputationPosted Jan 14, 2015, 8:55 PM EST
You can add validation at model level by using DataAnnonations. This is the best way of adding business validation.
using System.ComponentModel.DataAnnonations;
Eg- public class Customer
{
[Required]
public string CustomerName {get;set;}
}
For reference,
http://www.codeproject.com/Articles/256183/DataAnnotations-Validation-for-Beginner