【发布时间】:2021-12-14 11:12:16
【问题描述】:
在
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}"
我在此列的 DataGridCell 中为 TextBlock 设置了 WPF 样式。例如<Setter Property="TextAlignment" Value="Center"/>
现在此单元格的工具提示获得相同的居中文本对齐,但我想要
文本左对齐的工具提示。
以下不起作用,我不明白为什么不。
我该怎么办?
<Setter Property="ToolTip">
<Setter.Value>
<ToolTip>
<ToolTip.Content>
<TextBlock TextAlignment="Left" Text="{Binding [...].Tooltip}"></TextBlock>
</ToolTip.Content>
</ToolTip>
</Setter.Value>
</Setter>
【问题讨论】:
标签: wpf text-alignment