You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey all,
a long time ago (#11) there were some changes to the ValidatePropertyAsync method. I don't know if I use this the right way, but if I call NotifyOfPropertyChanged with null or string.Empty it does not validate the full model, instead it calls Validator.ValidatePropertyAsync(string.Empty).
I reverted the change to ValidatePropertyAsync in 35c1b33 to see if this fixes my problem, it did, but I don't know if this breaks something else.
protectedvirtualasyncTask<bool>ValidatePropertyAsync([CallerMemberName]stringpropertyName=null){if(this.Validator==null)thrownewInvalidOperationException("Can't run validation if a validator hasn't been set");if(String.IsNullOrEmpty(propertyName))returnawaitthis.ValidateAsync().ConfigureAwait(false);// To allow synchronous calling of this method, we need to resume on the ThreadPool.// Therefore, we might resume on any thread, hence the need for a lockvarnewErrorsRaw=awaitthis.Validator.ValidatePropertyAsync(propertyName).ConfigureAwait(false);...
protectedvirtualasyncTask<bool>ValidatePropertyAsync([CallerMemberName]stringpropertyName=null){if(this.Validator==null)thrownewInvalidOperationException("Can't run validation if a validator hasn't been set");if(propertyName==null)propertyName=String.Empty;// To allow synchronous calling of this method, we need to resume on the ThreadPool.// Therefore, we might resume on any thread, hence the need for a lockvarnewErrorsRaw=awaitthis.Validator.ValidatePropertyAsync(propertyName).ConfigureAwait(false);...
Thank you for this great framework!
Regards
Philipp
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey all,
a long time ago (#11) there were some changes to the ValidatePropertyAsync method. I don't know if I use this the right way, but if I call NotifyOfPropertyChanged with null or string.Empty it does not validate the full model, instead it calls Validator.ValidatePropertyAsync(string.Empty).
I reverted the change to ValidatePropertyAsync in 35c1b33 to see if this fixes my problem, it did, but I don't know if this breaks something else.
Before 35c1b33:
After 35c1b33:
Thank you for this great framework!
Regards
Philipp
Beta Was this translation helpful? Give feedback.
All reactions