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