This question is locked. New answers and comments are not allowed.
I have a treeview which uses a HierarchicalDataTemplate, consisting of an image and textblock within a stackpanel. The image source is determined by a converter which decides which image to return depending on the bound object type. This all works fine, but now I want to be able to show either an open or closed image for each object type, depending on whether the tree node is open or closed e.g. open folder image or closed folder image.
Is there any way to do this in the converter as well? How can I get to the treeviewitem itself to check if it is expanded or not?
Here is my HierarchicalDataTemplate:
The converter literally checks the type of the object bound to that node and returns an image path depending on which one it wants to show.
Thanks in advance :)
Debbie
Is there any way to do this in the converter as well? How can I get to the treeviewitem itself to check if it is expanded or not?
Here is my HierarchicalDataTemplate:
<telerik:HierarchicalDataTemplate x:Key="tvTelerikTreeTemplate" ItemsSource="{Binding Children}" > |
<StackPanel Orientation="Horizontal" ToolTipService.ToolTip="{Binding Path=Path}" > |
<Image Source="{Binding Converter={StaticResource ImageConverter}}" Width="15" Height="14"/> |
<TextBlock Text="{Binding Path=Name}" /> |
</StackPanel> |
</telerik:HierarchicalDataTemplate> |
The converter literally checks the type of the object bound to that node and returns an image path depending on which one it wants to show.
Thanks in advance :)
Debbie