Reputation: 5935
Here the problem. I have an ItemsControl, and I want to show a ToolTip if user hover mouse over ItemsControl. Seems easy, right?
Here an example:
<ItemsControl BorderBrush="Blue" BorderThickness="1">
<ItemsControl.ToolTip>
<ToolTip Content="Text" />
</ItemsControl.ToolTip>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<Label BorderBrush="Red" BorderThickness="1">One</Label>
<Label BorderBrush="Red" BorderThickness="1">Two</Label>
<Label BorderBrush="Red" BorderThickness="1">Three</Label>
<Label BorderBrush="Red" BorderThickness="1">Four</Label>
<Label BorderBrush="Red" BorderThickness="1">Five</Label>
<Label BorderBrush="Red" BorderThickness="1">Six</Label>
<Label BorderBrush="Red" BorderThickness="1">Seven</Label>
</ItemsControl>
Make window width small enough, and let WrapPanel to wrap an items. And try to hover over ItemsControl (ToolTip will not appears), than hover over Label (ToolTip will appears).
Why this behavior is right and how to force ToolTip to appears in this case?
Upvotes: 1
Views: 1420
Reputation: 17083
ToolTip
for ItemsControl
doesn't show in any case until you give the Background
a Brush
.
<ItemsControl Background="Transparent"
Upvotes: 5