I've got a ListBox that displays an ObservableCollection of Talent objects. When the user hovers over each item in the ListBox, I'd like to display in the ToolTip several pieces of information about the Talent.
My ListBox:
<ListBox ItemsSource="{Binding ElementName=CE_Races_racesLB, Path=SelectedItem.Talents}" ItemTemplate="{StaticResource removableTalentListTemplate}" />
The ItemTemplate:
<DataTemplate x:Key="removableTalentListTemplate">
<StackPanel>
<TextBlock FontSize="13" Text="{Binding Path=tName}" VerticalAlignment="Center" Width="175" Height="18" Grid.Column="0" />
</StackPanel>
</DataTemplate>
I can display the Description of the Talent if I add ToolTipService.ToolTip="{Binding Path=Description" to the TextBlock properties. However, when I try to create a custom ToolTip like such:
<DataTemplate x:Key="removableTalentListTemplate">
<StackPanel>
<TextBlock FontSize="13" Text="{Binding Path=tName}" VerticalAlignment="Center" Width="175" Height="18" Grid.Column="0" />
<TextBlock.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock Text="{Binding Path=Description}" />
</StackPanel>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</StackPanel>
</DataTemplate>
When I go to mouseover the ListBox item, the tooltip just says "System.Windows.Controls.StackPanel". I'd really like to create a nice ToolTip showing lots of info but I can't get past this roadblock. Here's a screenshot of what it looks like now: http://silkforge.com/dev/ss.jpg. You can't see the mouse, but you can see the tooltip just under the ListBox item "Acute Hearing I".
Border
control, copied and pasted into two different screens: one instance exhibits this problem and the other works exactly as it's supposed to. I'll dig more into this... – BCA