1

I want to perform validations for TextBoxes in WPF.
Validations are like,
1) Checking Emptiness of a Control
2) validating Email Address
3) validating Mobile Number

I know How to handling all kind of validations in Asp.Net. But Don't know in WPF.
Till now I am handling from code behind but I think that is not correct way. I want to perform validations after Click Event just like in our Asp.Net. Please give me your valuable suggestions.

Dennis
  • 37,026
  • 10
  • 82
  • 150
Sagar
  • 371
  • 9
  • 26
  • 3
    Actually, you can use the same way as ASP .NET MVC does - data annotations. In WPF you have to use it in combination with IDataErrorInfo interface. Since this isn't only possible solution, I won't mark this as duplicate, but here's a link: http://stackoverflow.com/a/7100959/580053 , and here's another one: http://stackoverflow.com/a/22362049/580053 – Dennis Jan 23 '16 at 06:45
  • 1
    Start reading here: [Data Validation](https://msdn.microsoft.com/en-us/library/ms752347(v=vs.100).aspx#data_validation). – Clemens Jan 23 '16 at 09:04
  • Thanks for your valuable suggestions now I got it. @Clemens – Sagar Jan 23 '16 at 11:28

0 Answers0