I'm using the INotifyDataError interface for async validation in WPF. I have a property
<TextBox Grid.Column="5"
Text="{Binding XXX.Name, ValidatesOnNotifyDataErrors=True}"/>
On my view model I have a property
public SomeType XXX
and on the type SomeType I have the property
public string Name
now my ViewModel implements INotifyPropertyChanged and INotifyDataError and validation is done asynchronously in my viewmodel class. SomeType only implements INotifyPropertyChanged.
My questions is this. When I raise ErrorsChanged
event with DataErrorsChangedEventArgs(propertyName))
what should the propertyName be. Note my Binding path is XXX.Name
. Should propertyName be
- XXX.Name
- Name
or something else or do I have to implement INotifyDataErrorInfo in my SomeType
class as well which I was hoping not to have to do as I want my validation to stay in the main view model.
Anyway I've tried both above and the textbox is not getting a red box around it though I can verify that the error event is being raised.
Point
class. If I have an individual text box for theX
and theY
fields respectively how would I provide validation feedback via INotifyDataErrorInfo? – Hydrophyte