Quantcast
Viewing latest article 6
Browse Latest Browse All 20

Created Unassigned: ViewModelDetailBase IsValid binding update [1616]

Hey,


I noticed if i bind my button to the IsValid property of a ViewModelDetailBase (SimpleMvvmToolkit-SL5) it doesn't get updated when there is a validation error.
I think the problem is in the setter of the Model in that class.

The code:
```
if (notifyDataErrorInfo != null)
notifyDataErrorInfo.ErrorsChanged += (EventHandler<DataErrorsChangedEventArgs>) ((s, ea) =>
{
if (!this.ModelMetaProperties.Contains(ea.PropertyName))
return;
BindingHelper.InternalNotifyPropertyChanged("IsValid", (object) this, this.propertyChangedField, this.Dispatcher);
});
```

Description of ModelMetaProperties:
> Model meta-properties which should be ignored when handling property changed events,
and when dirty-checking or performing validation.

While debugging i notice that ea.PropertyName is the name of the property that has a error.
That name will normaly not be in the ModelMetaProperties list.
Resulting that BeginHelper wont get called.
If i compair it with the code in ViewModelDetailBaseCore i see that it is implemented correct there.
So i think you should remove the ! operator in if (!this.ModelMetaProperties.Contains(ea.PropertyName)).


Greetings
Skoucail

Viewing latest article 6
Browse Latest Browse All 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>