WPF TabControl and DataTemplates

后端 未结 5 742
名媛妹妹
名媛妹妹 2021-02-03 11:24

I\'ve got a set of ViewModels that I\'m binding to the ItemsSource property of a TabControl. Let\'s call those ViewModels AViewModel, BViewModel, and CViewModel. Each one of tho

5条回答
  •  梦谈多话
    2021-02-03 11:56

    The easiest way would be to use the automatic template system, by including the DataTemplates in the resources of a ContentControl. The scope of the templates are limited to the element they reside within!

    
        
            
                
                    
                        
                            ...
                        
                        
                            ...
                        
                        
                            ...
                        
                    
                
            
        
        
            
                ...
            
             
                ...
            
            
                ...
            
        
    
    

提交回复
热议问题