I got 2 string data fields on a form. My rule is the value of the 2 data fields cannot be the same and not empty. It seems it does work well to check the rule because of data changed is not raised again until the value is changed again. Ex: F1 = F2 empty string ==> Invalid data. F1 = 1, F2 =2 ==> Pass. F1 = 2; F2 = 2 ==> F1 invalid (red rectangle). F2= 3 ==> F1 still having red rectangle because data is not changed so it will not evaluate again although F1 <> F2 on the screen but the error message is still F1 = F2. If I change F1 to something else and back to 2 then it is OK because it has been evaluated again. I ended up checking the F1 and F2 data field when user tries to save the form. How would you handle this scenario? Thanks
How to properly check 2 related data fields using INotifyDataErrorInfo on WPF form?
37 views Asked by Thich Coi Phim At
1