3
我似乎无法将工具提示绑定到DataGridCell的内容,而没有让单元格中的内容消失。换句话说,当我将鼠标悬停在单元格上时,工具提示按预期显示,但单元格内容不再可见(永久性除非我向下滚动列表并备份)。贝娄是WPF我遇到的麻烦:当工具提示显示时DataGridCell内容消失
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Content, Mode=OneWay}">
</Setter>
</Style>
</DataGrid.CellStyle>
我能做些什么,从消失的工具提示显示时停止DataGridCell的内容?
有没有办法让这个更通用的模板?即我有一个模板,上面有一个关键字“DataGridCellWithToolTip”,它具有以下设置器,并且具有与上面相同的问题 –
bgura
2014-08-29 19:07:42
@Thatoneguy,好吧,如果你想为此添加一个Style,你可以添加一个[Converter](http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter%28v=vs。 110%29.aspx)绑定到您的绑定,它将从控件提取值并将其作为文本返回。在这里我想不出其他的通用方法。 – icebat 2014-08-29 19:27:50