I\'m trying to change the icon of my TreeView in a folder icon. Also when it collapses it needs to have an opened folder icon.
My treeview has databound items in it and
Incidentally i did something like this just a few days ago. In my application a folder icon is added in the HierarchicalDataTemplate to those objects which behave like folders, i use a trigger to change the icon based on whether the item is expanded or not, here's the relevant bit of XAML:
Where {StaticResource Icon_FolderOpen}
and {StaticResource Icon_FolderClosed}
are BitmapImages
that hold the icons for the folder states. IconImageStyleSmall
is a style which sets the MaxWidth
and MaxHeight
of the images to something appropriate.
Edit: For completion's sake.
Icons used