Add n rectangles to canvas with MVVM in WPF

前端 未结 2 1787
轻奢々
轻奢々 2020-11-22 02:39

I want to add a set of rectangles to the main window of my mvvm application. In my viewModel I\'ve got a collection of objects which I convert to System.Windows.Shapes.Recta

2条回答
  •  一个人的身影
    2020-11-22 03:18

    You can bind the collection of rectangles to an ItemControl and set its height, width and margin:

    
        
            
                
                    
                
            
        
    
    

    Just an idea to get you started...

提交回复
热议问题