Hide item if binded value is null?
<p>I've a <code>ListBox</code> like this:</p>

<pre><code>&lt;ListBox VerticalAlignment="Stretch"
         ItemsSource="{Binding EventInfo}"&gt;
</code></pre>

<p>inside it I've a <code>DataTemplate</code> with a list of TextBlock:</p>

<pre><code>&lt;ListBox.ItemTemplate&gt;
    &lt;DataTemplate&gt;
        &lt;Grid&gt;
           &lt;Grid.ColumnDefinitions&gt;
               &lt;ColumnDefinition Width="100"/&gt;
               &lt;ColumnDefinition Width="20"/&gt;
           &lt;/Grid.ColumnDefinitions&gt;
           &lt;Grid.RowDefinitions&gt;
                &lt;RowDefinition/&gt;
                &lt;RowDefinition/&gt;
           &lt;/Grid.RowDefinitions&gt;
          &lt;TextBlock Text="Event:" FontWeight="Bold" Grid.Column="0" Grid.Row="0"/&gt;
          &lt;TextBlock Text="{Binding Name}" FontWeight="Bold" Grid.Column="1" Grid.Row="0"/&gt;
         &lt;/Grid&gt;
    &lt;/DataTemplate&gt;
 &lt;/ListBox.ItemTemplate&gt;
&lt;/ListBox&gt;
</code></pre>

<p>what I need to do is hide the textblock when for example, the binded value is <code>null</code>. I've associate this stuff:</p>

<pre><code>Event: foo
</code></pre>

<p>but in some case the <code>Name</code> is null, I need to hide both <code>TextBlock</code> <code>Event</code> and the binded, is possible do this?</p>

<p><strong>UPDATE:</strong></p>

<p>I'm trying to do this pure in xaml as:</p>

<pre><code>&lt;Style TargetType="TextBlock"&gt;
     &lt;Style.Triggers&gt;
          &lt;Trigger Property="Text" Value=""&gt;
              &lt;Setter Property="Visibility" Value="Collapsed" /&gt;
          &lt;/Trigger&gt;
          &lt;Trigger Property="Text" Value="{x:Null}"&gt;
              &lt;Setter Property="Visibility" Value="Collapsed" /&gt;
          &lt;/Trigger&gt;
     &lt;/Style.Triggers&gt;
&lt;/Style&gt;
</code></pre>

<p>The problem's that the application fall in interruption mode and as xaml error I get:</p>

<blockquote>
  <p>System.Windows.Data Error: 40 : BindingExpression path error: 'Name' property not found on 'object' ''Style' (HashCode=7)'.</p>
</blockquote>

<p>this error is repeated for each textblock that I've what am I doing wrong?</p>