How can I disable a button until required data is entered in a TextBox?
I'm binding an Button to ICommand
public ICommand LoginCommand
{
get
{
if (_loginCommand == null)
{
_loginCommand = new DelegateCommand<string>(this.Login, this.IsValid);
}
return _loginCommand;
}
}
in XAML like this:
<Button Style="{StaticResource LoginButton}" Content="Login" Command="{Binding LoginCommand}" CommandParameter="{Binding Text, ElementName=txtUserName}" />