我在列表框内的图像上有一个工具提示。工具提示设置如下:
<Image Grid.Column="0" Source="{Binding PingRankImage}"
Width="16" Height="16"
HorizontalAlignment="Center" VerticalAlignment="Center">
<Image.ToolTip>
<ToolTip Content="{Binding Ping, StringFormat='Ping: {0}ms'}"
ContentStringFormat="{}Ping: {0}ms}" />
</Image.ToolTip>
</Image>
但工具提示仅显示该值,而不显示“Ping:XXXms”
有任何想法吗?
你不需要额外的{}
前缀在ContentStringFormat
. With ToolTip
,也更喜欢使用ContentStringFormat
代替StringFormat
在绑定中。
以下作品:
<Image.ToolTip>
<ToolTip Content="{Binding}"
ContentStringFormat="Ping: {0}ms" />
</Image.ToolTip>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)