title: Binding the value of a Setter Property in WPF
body: <p>I have spent all day looking for a way to display a default string of text on a <code>ComboBox</code> and the closest I managed to find that worked was an example that uses watermarking. When my application opens, the <code>ComboBox</code>'s Visibility property is set to Collapsed and then made visible by a command. Unfortunately, I can't get the watermark to follow suit. Here is what I'm working with:</p>
  
  <pre><code>&lt;Style x:Key="watermarkLabelStyle"&gt;
      &lt;Setter Property="TextBlock.Foreground" Value="Black" /&gt;
      &lt;Setter Property="FrameworkElement.Opacity" Value="0.8" /&gt;
      &lt;Setter Property="TextBlock.FontSize" Value="12" /&gt;
      &lt;Setter Property="TextBlock.FontStyle" Value="Italic" /&gt;
      &lt;Setter Property="TextBlock.Margin" Value="8,4,4,4" /&gt;
      &lt;Setter Property="TextBlock.Visibility" Value="{Binding Visible}" /&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p><code>{Binding Visible}</code> has no effect even though other controls in the window are bound to it and behave properly.</p>
  
  <pre><code>&lt;ComboBox ItemsSource="{Binding LeagueFormatsNode}"
            x:Name="leagueFormatComboBox"
            Grid.Column="0"
            Grid.Row="1"
            Grid.ColumnSpan="3"
            ScrollViewer.CanContentScroll="False"
            HorizontalContentAlignment="Stretch"
            Visibility="{Binding Visible}"
            Behaviors:WatermarkComboBoxBehavior.EnableWatermark="True"
            Behaviors:WatermarkComboBoxBehavior.Label="Select League Format"
            Behaviors:WatermarkComboBoxBehavior.LabelStyle="{StaticResource watermarkLabelStyle}" /&gt; 
  </code></pre>
  
  <p>And the <code>Visible</code> property in the viewmodel:</p>
  
  <pre><code>public Visibility Visible
  {
      get { return _visibile; }
      set
      {
          if (_visibile == value)
              return;
          _visibile = value;
          RaisePropertyChanged(() =&gt; Visible);
      }
  }
  </code></pre>
  
  <p>What can I do to make the setter in the style behave and register the binding?</p>
  
  <p>If you need additional code, I'll gladly provide it.</p>
  
  <hr>
  
  <p><strong>Update:</strong> Snoop is showing a binding error on the TextBlock's Visibility property. On the DataContext tab, it says "object is null". I have been looking for a way to fix this but I haven't been able to figure out how. If anybody would be kind enough to push me in the right direction, I would certainly appreciate it. The code came from here <a href="http://archive.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=PierreCode&amp;ReleaseId=3546">http://archive.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=PierreCode&amp;ReleaseId=3546</a></p>
  
  <p>I'm not necessarily looking for a complete walkthrough, just enough advice to guide me to the solution.</p>