<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Margin="5">
        <StackPanel.Resources>
            <Style TargetType="{x:Type TextBox}">
                <Style.Triggers>
                    <DataTrigger
Binding="{Binding RelativeSource={RelativeSource Self}, Path=Text.Length}"
Value="140">
                     
                        <Setter Property="Background" Value="Salmon" />

                    </DataTrigger>
                </Style.Triggers>
                <Setter Property="FontSize" Value="11"/>
                <Setter Property="MaxLength" Value="140"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
            </Style>
        </StackPanel.Resources>
        <TextBox/>
    </StackPanel>