DataTrigger to make WPF Button inactive until TextBox has value

Posted by JohnB on Stack Overflow See other posts from Stack Overflow or by JohnB
Published on 2011-01-11T20:35:41Z Indexed on 2011/01/11 20:53 UTC
Read the original article Hit count: 825

Filed under:

I want the Button control's property to be IsEnabled="False" until a value is entered into a TextBox in the Window.

Code so far:

  Content="Click Me"
          Binding="{Binding ElementName=textBox, Path=Length}"
          <!-- or even: Binding="{Binding Path=textBox.Length}" -->
            Value="false" />

Also, is it possible to have this Button control's IsEnabled property be based on 3 different TextBox controls all having values?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about wpf-binding