Yes, this is the way IDataErrorInfo
works, it will only query for a validation error when a property change notification happens. So ideally your Size
property would look like this:
public int? Size
{
get
{
return this.size;
}
set
{
if (value == this.Size)
{
return;
}
this.size = value;
this.OnPropertyChanged("Size");
this.OnPropertyChanged("StrVal");
}
}
Even though you may not be doing any validation on the size property, you should still (as a matter of "best practice") send the property change notification.