【发布时间】:2009-10-19 09:11:40
【问题描述】:
在TextBox 中输入所需数据之前,如何禁用Button?
我将Button 绑定到ICommand:
public ICommand LoginCommand
{
get
{
if (_loginCommand == null)
{
_loginCommand = new DelegateCommand<string>(this.Login, this.IsValid);
}
return _loginCommand;
}
}
在 XAML 中像这样:
<Button Style="{StaticResource LoginButton}" Content="Login" Command="{Binding LoginCommand}" CommandParameter="{Binding Text, ElementName=txtUserName}" />
【问题讨论】: