如何在WPF中的ListView控件中添加文本,图像 [英] How to add text ,images in listview control in wpf

查看:367
本文介绍了如何在WPF中的ListView控件中添加文本,图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在wpf的listview控件中添加文本,图像

下面的例子

第1列|第2列|专栏3
raj图片+文字图片

How to add text ,images in listview control in wpf

Example as below

Column1 | Column2 | Columns3
raj image + text images

Any help or suggestion for this would be of great help

推荐答案

列表视图项目具有content属性,这意味着您可以在其中嵌入任何控件并帮助选择该项目. ...
List View Items have content property which means you can embedd any controls in them and help to select the item....


您在问一个非常开放的问题,因为您没有说明图像的来源.有很多可能性:可能来自ViewModel作为图像(例如来自数据库),可能是路径(或URI),或者可能是图像依赖于某些其他数据(例如类型)的情况.记录.这是一个可能有所帮助的链接: http://www. netframeworkdev.com/windows-presentation-foundation-wpf/listview--datatemplate--images-29390.shtml [
You are asking a very open question because you are not stating where the images are coming from. There are a number of possibilities: Could be coming from the ViewModel as an image (like from a database), could be a path (or URI), or could be a case where the image is dependent on some other data like the type of record. Here is one link that might help: http://www.netframeworkdev.com/windows-presentation-foundation-wpf/listview--datatemplate--images-29390.shtml[^]


这篇关于如何在WPF中的ListView控件中添加文本,图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆