I have created a WPF project with MVVM pattern. I have a Customer Entity class. I have a NewCustomer userControl whose datacontext is CustomerViewModel which has a property Customer of type Customer Entity. The usercontrol has fields like Name, Id, Country..
My requirement is the combination of Name, ID and Country should be unique, that is not other customer with the same combination should not be there in the database. So, after the user enter all the 3 fields, I have raise a command which will inturn call the service to check if the current customer is duplicate or not. If it is duplicate the 3 textboxes should have red border.
I tried by creating a LostFocus attached dependecny property, but since the TextBoxes datacontext will be Customer Entity , even after biding a command which is there in the ViewModel it is not getting fired.