How to add controls in the tab item programmatically in wpf with MVVM

前端 未结 3 1223
后悔当初
后悔当初 2021-02-06 17:05

I have created a tab control and Created the tabItems dynamically, but i dont know how to add controls into the tabItems using MVVM. Could any one help me

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-06 17:32

    You Dont have to add controls you just have to specify the UserControl.

    TabControl has two properties ItemTemplate && Content Template

    ItemTemplate is for how the Tab will look where as

    ContentTemplate is how the Tab Content will Look... so...

    Xaml for the above

                                                   >
                    
                        
                            
                                
                                
                            
                        
                    
                    
                    
                        
                    
                            
                        
                     
    

提交回复
热议问题