<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="200">
  <StackPanel.Resources>
    <Style TargetType="{x:Type TextBox}">
      <Style.Triggers>
        <DataTrigger
        Binding="{Binding RelativeSource={RelativeSource Self}, Path=Text}"
        Value="disabled">
          <Setter Property="IsEnabled" Value="False"/>
        </DataTrigger>
      </Style.Triggers>
      <Setter Property="Background"
      Value="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
    </Style>
  </StackPanel.Resources>
  <TextBox Margin="3"/>
  <TextBox Margin="3"/>
  <TextBox Margin="3"/>
  <TextBox Margin="3"/>
</StackPanel>