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
I am creating some form ViewModels and I want to dynamically disable SaveCommand when the form is invalid. However I don't see any simple way to do this.
There are 3 workarounds (?) I can think of:
add NotifyCanExecuteChangedFor attribute to all properties that need to be validated
however neither of these feel clean to me.
Is there anything I've missed?
I would imagine some attribute similar to NotifyCanExecuteChangedFor, that would be applied to the form class and would react to the validation state. Or maybe at least partial OnHasErrorsChanged. Is this a feature request worthy thing?
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
-
I am creating some form ViewModels and I want to dynamically disable SaveCommand when the form is invalid. However I don't see any simple way to do this.
There are 3 workarounds (?) I can think of:
NotifyCanExecuteChangedFor
attribute to all properties that need to be validatedthis.ErrorsChanged
OnPropertyChanged
like this:however neither of these feel clean to me.
Is there anything I've missed?
I would imagine some attribute similar to
NotifyCanExecuteChangedFor
, that would be applied to the form class and would react to the validation state. Or maybe at leastpartial OnHasErrorsChanged
. Is this a feature request worthy thing?Beta Was this translation helpful? Give feedback.
All reactions