Setting up WPF treeview triggers to show different images on expand

前端 未结 2 986
臣服心动
臣服心动 2021-02-09 18:58

I have a wpf tree view that displays nodes of various types with corresponding images such as folder images. Initially, the tree and its nodes with corresponding images display

2条回答
  •  死守一世寂寞
    2021-02-09 19:05

    For completeness, the original setup with the HierarchicalDataTemplate triggers just needed to use a RelativeSource binding (as indicated by HB's answer), such as:

    
        
            
            
        
        
            
                
            
        
    
    

    Below is an example image with different images on expand in the TreeView:

    Tree view with images

提交回复
热议问题