I have a window that I display as ShowDialog in the window I have some textboxes binding to object that implement INotifyPropertyChannges and IDataErrorInfo. I want that the OK button will enabled just if all thextboxes validted and I want that just if the user click on OK buton the next move will occur.
I can bind the button to ICommand and check the textboxes valitation in CanExcute() but then what can I do in the Excute? the object dont know about the window. I can also check the textboxes valitation and then raise event that all valid and enable the OK button but then there will be dupliacte code because I checked already in the IDataErrorInfo implmention.
So what is the right way?
Thanks in advance