title: WPF: Setting Canvas color in a DataTrigger when bound value is null
body: <p>I'm binding the Background property of a Canvas to some <strong>SelectedColorItem</strong> object like this:</p>
  
  <pre><code>&lt;Canvas&gt;
      &lt;Canvas.Style&gt;
          &lt;Style TargetType="Canvas"&gt;
              &lt;Style.Triggers&gt;
                  &lt;DataTrigger Binding="{Binding Path=SelectedColorItem,Mode=OneWay,Converter={StaticResource isNullConverter}}"
                                               Value="True"&gt;
                       &lt;Setter Property="Background" Value="Red" /&gt;
                   &lt;/DataTrigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
      &lt;/Canvas.Style&gt;
      &lt;Canvas.Background&gt;
          &lt;SolidColorBrush Color="{Binding SelectedColorItem.MediaColor}" /&gt;
      &lt;/Canvas.Background&gt;
  &lt;/Canvas&gt;
  </code></pre>
  
  <p>It works - it displays the selected color.
  What does not work it the DataTrigger which I wrote to indicate that the <strong>SelectedColorItem</strong> is null.</p>
  
  <p>The simplest <strong>isNullValueConverter</strong> works either - it might be varified with a Label:</p>
  
  <pre><code>&lt;Label Content="{Binding Path=SelectedColorItem,Mode=OneWay,Converter={StaticResource isNullConverter}}" /&gt;
  </code></pre>
  
  <p>It shows <strong>True</strong>, when SelectedColorItem is null and <strong>False</strong> otherwise.</p>
  
  <p>Could somebody tell me what's wrong with the trigger?</p>
  
  <p>P.S.
  SelectedColorItem is an instance of a ColorItemClass which contains a MediaColor property:</p>
  
  <pre><code>public System.Windows.Media.Color MediaColor {get;set;}
  </code></pre>