行为风格怪异。请解释一下
我有一种风格:
<Style TargetType="Image">
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality" />
<Setter Property="Width" Value="24" />
<Setter Property="Height" Value="24" />
</Style>
它按照预期调整面板内所有图像的大小。但是,它不会影响 DataGrid 行内的图像。为什么?如何解决这个问题?
I have a style:
<Style TargetType="Image">
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality" />
<Setter Property="Width" Value="24" />
<Setter Property="Height" Value="24" />
</Style>
It resizes all images inside a panel, as it was intended. However, it doesn't affect images inside DataGrid rows. Why? How to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,DataGrid 会覆盖所有样式,因为它应用自己的两种不同样式,一种用于编辑单元格,另一种用于其正常外观。
As far as i know DataGrid overrides all styles since it applies two different styles of its own, one for editing the cell and one for its normal appearance.