title: WPF DataContext in ToolTip
body: <p>I'm trying to bind the tooltip of a ListBoxItem. I have this defined in my ControlTemplate:</p>
  
  <pre><code>&lt;ControlTemplate TargetType="{x:Type ListBoxItem}"&gt;
      &lt;ControlTemplate.Resources&gt;
          &lt;conv:IconConverter x:Key="IconConverter" /&gt;
          &lt;conv:FirstImageConverter x:Key="FirstImageConverter"/&gt;
          &lt;conv:DebugConverter x:Key="dbg"/&gt;
      &lt;/ControlTemplate.Resources&gt;
  &lt;Border ...&gt;
      &lt;StackPanel&gt;
          &lt;Image MaxHeight="160" Stretch="UniformToFill" Source="{Binding Icon,Converter={StaticResource IconConverter},ConverterParameter=128}" Height="128"/&gt;
          &lt;TextBlock x:Name="lblName" Text="{Binding Name}" /&gt;
      &lt;/StackPanel&gt;
      &lt;Border.ToolTip&gt;
          &lt;DockPanel LastChildFill="True" Margin="2" MaxWidth="800" 
          DataContext="{Binding Images,Converter={StaticResource FirstImageConverter}}" 
          IsEnabled="{Binding Images,Converter={StaticResource FirstImageConverter},ConverterParameter=enabled}"&gt;
              &lt;TextBlock DockPanel.Dock="Bottom" Width="Auto" MaxWidth="600"  Text="{Binding Caption}" Height="Auto" /&gt;
              &lt;Image x:Name="imgFullSize" DockPanel.Dock="Top" Stretch="None" Width="Auto" Source="{Binding Filename,Converter={StaticResource IconConverter}}"/&gt;
          &lt;/DockPanel&gt;
      &lt;/Border.ToolTip&gt;
  </code></pre>
  
  <p>Yes I get a binding error: <code>System.Windows.Data Error: 3 : Cannot find element that provides DataContext. BindingExpression:Path=Images; DataItem=null; target element is 'DockPanel' (Name=''); target property is 'DataContext' (type 'Object')</code></p>
  
  <p>My ListBoxItem's datacontext does contain the images property as it does the name and icon properties, which are displayed correctly. I've also tried using <code>TooltipService.ToolTip</code> instead of <code>Border.ToolTip</code>, with no effect. What's the difference, and why isn't my binding working?</p>