在WPF DataGrid的图像列 [英] Image Column in WPF DataGrid
本文介绍了在WPF DataGrid的图像列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在windows窗体创建这个这样的图像列:
I create this such image column in windows form:
我怎么能在WPF创建此列和处理点击?
How I can create this columns in WPF and handle click on them?
感谢
推荐答案
您可以使用 DataGridTemplateColumn
为。创建一个 CellTemplate
包含按钮
的内容
是一个图片
,你可以风格的按钮是看不见的通过改变它的模板
来一个简单的 ContentPresenter
。
You can use a DataGridTemplateColumn
for that. Create a CellTemplate
that contains a Button
whose Content
is an Image
, you can style the button to be "invisible" by changing its Template
to a simple ContentPresenter
.
这篇关于在WPF DataGrid的图像列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文