I have a list I want to show in a tooltip, but when it is empty the tooltip should not exist. However, when it is empty it still shows a very small, empty box.
我有一个我希望在工具提示中显示的列表,但是当它为空时,工具提示不应该存在。但是,当它为空时,它仍然显示一个非常小的空盒子。
<t:RadDropDownButton.ToolTip>
<t:RadToolTip Visibility="{Binding MyList, Converter={StaticResource EmptyListToCollapsedConverter}}"
Content="{Binding MyList}">
<t:RadToolTip.ContentTemplate>
<DataTemplate>
<ItemsControl ItemsSource="{Binding}"/>
</DataTemplate>
</t:RadToolTip.ContentTemplate>
</t:RadToolTip>
</t:RadDropDownButton.ToolTip>
What's wrong with this? It happens anywhere RadToolTip is used. Setting its Visibility doesn't work!
这有什么问题?它发生在使用RadToolTip的任何地方。设置其可见性不起作用!
2 个解决方案
#1
0
I think this would happen even if you just the Tooltip class. MS does not assume the tooltip should not show. If you set the tooltip property of an element and want to hide/suppress it then set the attached ToolTipService.IsEnabled to false.
我认为即使你只是Tooltip类也会发生这种情况。 MS不认为工具提示不应显示。如果设置元素的tooltip属性并想隐藏/禁止它,则将附加的ToolTipService.IsEnabled设置为false。
#2
0
It's been a while since I asked this, but it turned out I was using the control incorrectly. The tool tip was supposed to be applied in a different place. Sorry that's all I can remember!
我问了这个问题已经有一段时间了,但事实证明我错误地使用了控件。工具提示应该应用于不同的地方。对不起,这就是我记得的全部!
#1
0
I think this would happen even if you just the Tooltip class. MS does not assume the tooltip should not show. If you set the tooltip property of an element and want to hide/suppress it then set the attached ToolTipService.IsEnabled to false.
我认为即使你只是Tooltip类也会发生这种情况。 MS不认为工具提示不应显示。如果设置元素的tooltip属性并想隐藏/禁止它,则将附加的ToolTipService.IsEnabled设置为false。
#2
0
It's been a while since I asked this, but it turned out I was using the control incorrectly. The tool tip was supposed to be applied in a different place. Sorry that's all I can remember!
我问了这个问题已经有一段时间了,但事实证明我错误地使用了控件。工具提示应该应用于不同的地方。对不起,这就是我记得的全部!