我想在工具提示中显示一个列表,但是当它为空时,工具提示不应该存在。但是,当它为空时,它仍然显示一个非常小的空盒子。
<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>
这有什么问题?它发生在使用RadToolTip的任何地方。设置其可见性不起作用!
答案 0 :(得分:0)
我认为即使您只是Tooltip类也会发生这种情况。 MS不假设工具提示不应显示。如果设置元素的tooltip属性并想隐藏/禁止它,则将附加的ToolTipService.IsEnabled设置为false。
答案 1 :(得分:0)
我问过这个问题已经有一段时间了,但事实证明我错误地使用了控件。工具提示应该应用于不同的地方。对不起,我记得很清楚!