Fill xaml rectangle multiples solidcolorbrush

前端 未结 2 452
旧巷少年郎
旧巷少年郎 2021-01-14 12:02

This type of fill in rectangle in xaml is it possible?

\"enter

I don\'t want

2条回答
  •  孤城傲影
    2021-01-14 12:55

    Re: your comment -- is the concern simply that it's an N amount of rectangles? If it's not a constraint that it all be one rectangle, you could do something like this:

        
            
                
                    
                        
                            
                                
                            
                        
                        
                            
                                
                            
                        
                    
                
            
        
    

    and

    ColorsTiles = new ObservableCollection>() {
            new ObservableCollection(){ new SolidColorBrush(Colors.LightGreen), new SolidColorBrush(Colors.LightBlue), new SolidColorBrush(Colors.Blue) },
            new ObservableCollection(){ new SolidColorBrush(Colors.LightSeaGreen), new SolidColorBrush(Colors.Pink), new SolidColorBrush(Colors.Red) } };
    

提交回复
热议问题