Setting up WPF treeview triggers to show different images on expand

前端 未结 2 993
臣服心动
臣服心动 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:13

    This question might be relevant.

    As in my answer to the question I linked I would do the triggering in the image via RelativeSource binding, you can refactor that into a style so you do not have all that redundant code.

    Possibly you could work with DynamicResources to provide the two images to every Image-control, or you could sub-class Image or create a UserControl which provides properties.


    The DynamicResource method:

    
        
    
    
    
    
        
            
                
                    
                    
                
            
            
        
    
    

提交回复
热议问题