I'm new to xaml and not sure how databind works. I'm trying to enable hint text when my text box is null. But I'm not sure how the data bind work to disable it when it's not null.
Here is a solution I found that works to get my hint text. How do this code to work to disable it if my first name textbox has a value?
<TextBox Grid.Row="1">
<TextBox.Style>
<Style TargetType="TextBox" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Style.Resources>
<VisualBrush x:Key="CueBannerBrush" AlignmentX="Left" AlignmentY="Center" Stretch="None">
<VisualBrush.Visual>
<Label Content="First Name" Foreground="LightGray" />
</VisualBrush.Visual>
</VisualBrush>
</Style.Resources>
<Style.Triggers>
<Trigger Property="Text" Value="{x:Static sys:String.Empty}">
<Setter Property="Background" Value="{StaticResource CueBannerBrush}" />
</Trigger>
<Trigger Property="Text" Value="{x:Null}">
<Setter Property="Background" Value="{StaticResource CueBannerBrush}" />
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter Property="Background" Value="White" />
</Trigger>
</Style.Triggers>
</Style>
</TextBox.Style>
<TextBox.Template>
<ControlTemplate>
<TextBox Text="{Binding SelectedItem.FirstName,UpdateSourceTrigger=PropertyChanged}"/>
</ControlTemplate>
</TextBox.Template>
</TextBox>