Microsoft MVVM toolkit
I have a very simple question
I have two entries and a button
[RelayCommand]
async Task Register() {
IsPopOpen = false;
//await dataService.AddAsync("Users", Student);
}
```
what I want to do is enable the button only if the email and password are entered
5 Replies
@ref *&Sergio this is the toolkit of yours, right?
Yeah
You'll want to define some
bool CanRegister
property or method in your viewmodel. Make that check that the password and email are not empty. Make those two observable properties and have them notify the command. Then make the command have CanExecute = nameof(CanRegister)
See docs herethanks
can you help me @ref *&Sergio
This is not what you said earlier though, I thought you were modifying properties in that viewmodel. You're instead setting properties that are nested in that
Student
type. That will not work as iswhy jnot