views:

527

answers:

1

Hi,

In WPF using IDataErrorInfo and Style I want to create form where I can provide end user three different status while validating data To make scenario more clear

1) I have textbox next to it I have icon which provides end user what kind of input textbox expects - Initial status with information icon

2) As soon as user enter data it validates it and decides whether it is valid or not - most of the time it will show cross (X) icon saying invalid data

3) As it is validation on UpdateSourceTrigger="PropertyChanged" it will turn cross icon to green check mark as soon as it gets validated

i.e

[ ] i (tooltip- Any valid user name ) [Ga ] X (tooltip- Invalid user name. Must be 5 char long) [Gaurav ] * (it will show only correct icon, meaning valid value)

How can i achieve this using IDataErrorInfo and Style, I tried doing that but as soon as my form gets loaded it invalidates all the data and shows cross icon at the first time. I want to show different tooltip and different icon for three stats(Inital info, Invalid data , Valid data)

Thank You and Happy Programming Gaurav

A: 

you can find a great example here WPF Apps With The Model-View-ViewModel Design Pattern

ArsenMkrt