Having HierarchicalDataTemplates in a TreeView

前端 未结 1 1522
青春惊慌失措
青春惊慌失措 2020-12-02 23:17

With regards to a question I posted earlier on (WPF: Correctly storing an object in a TreeViewItem)

Is it possible to have nested Hierarchical

1条回答
  •  感情败类
    2020-12-02 23:36

    You dont need a nested template here, since TreeView control will take care of nesting it based on the DataType it requires. So just define Two HierarchicalDataTemplates for Album and Artist Type and one ordinary DataTemplate for your Track class.

                 
                              
        
        
            
                
        
            
        
    

    0 讨论(0)
提交回复
热议问题