title: WPF Hide TextBlock if Text is entered into TextBox Trigger
body: <p>How can I use XAML Triggers to hide a TextBlock when text is entered into the TextBox in my Style. This is the code I have got now, which doesn't work, no errors, is just probably wrong. How do I go about doing this?</p>
  
  <pre><code>&lt;Style TargetType="TextBox"&gt;
          &lt;Setter Property="Background" Value="#FF22252C" /&gt;
          &lt;Setter Property="Foreground" Value="White" /&gt;
          &lt;Setter Property="Width" Value="200" /&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="TextBox"&gt;
                      &lt;Border CornerRadius="5" Background="#FF22252C" Margin="3" MinWidth="{TemplateBinding MinWidth}"&gt;
                          &lt;Grid&gt;
                              &lt;StackPanel Margin="8"&gt;
                                  &lt;ScrollViewer x:Name="PART_ContentHost"/&gt;
                              &lt;/StackPanel&gt;
                              &lt;StackPanel&gt;
                                  &lt;TextBlock Name="PART_TempText" Text="{TemplateBinding Name}" Foreground="#FF454954" Padding="8" /&gt;
                              &lt;/StackPanel&gt;
                          &lt;/Grid&gt;
                      &lt;/Border&gt;
                      &lt;ControlTemplate.Triggers&gt;
                          &lt;Trigger Property="Text" Value="{x:Null}"&gt;
                              &lt;Setter TargetName="PART_TempText" Property="Foreground" Value="Red" /&gt;
                          &lt;/Trigger&gt;
                      &lt;/ControlTemplate.Triggers&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  </code></pre>