How can I position ViewModels in an ItemsControl

后端 未结 1 1788
醉话见心
醉话见心 2021-01-16 05:43

My mainwindow ViewModel has an ObservableCollection of ViewModels, called ViewModels.

The Mainwindow XAML has an ItemsControl with ItemsSource bound to ViewModels.

1条回答
  •  日久生厌
    2021-01-16 06:09

    Make your ItemsControl.ItemsPanel into a Canvas, and set your Top/Left/Height/Width in the ItemTemplate.

    
        
            
                
                
            
        
    
        
            
        
    
        
            
                
                    
                
            
        
    
    

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