Binding TabControl ItemsSource to Collection of ViewModels

后端 未结 1 1747
一整个雨季
一整个雨季 2021-01-02 08:53

For some reason I am having a heck of a time getting my TabControl to display properly when binding the ItemsSource to a ObservableCollection

1条回答
  •  温柔的废话
    2021-01-02 09:28

    I ended up using a ContentControl with a TabControl data template (like the original tutorial project). Here is the xaml code I ended up with. I did not change the code-behind from the original sample project to make this work. The ContentControl is in my MainWindow.xaml and the other two pieces of code were in a ResourceDictionary.

    
          
    
    
      
        
      
    
    
    
      
        
          
            
              
            
          
        
      
    

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