如何在WPF TreeView中的节点旁边添加图标? [英] How do I add icons next to the nodes in a WPF TreeView?

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

问题描述

我有一个WPF TreeView,仅包含1个级别的项目。 TreeView是绑定到字符串的ObservableCollection的数据。如何确保相同的图标出现在TreeView的每个节点的左侧?

I have a WPF TreeView with just 1 level of items. The TreeView is data bound to an ObservableCollection of strings. How can I ensure that the same icon appears to the left of each node in the TreeView?

推荐答案

我认为是最好的方法之一可以帮助您了解TreeView的文章就是 http://www.codeproject.com /KB/WPF/TreeViewWithViewModel.aspx 。通常,这描述了一组好的模式,这些模式可以使WPF / SL中的许多场景更加容易。

I think one of the best articles that will help you to understand the TreeView is this one http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx. In general, this describes a good set of patterns that can make a lot of scenarios in WPF/SL much easier.

这篇关于如何在WPF TreeView中的节点旁边添加图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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