TextBlock TextWrapping not wrapping

前端 未结 4 551
野趣味
野趣味 2020-12-10 00:48

When I place a TextBlock inside of a Horizontally Aligned StackPanel it does not wrap. I realize that this is because the available width of the StackPanel is PositiveInfini

4条回答
  •  甜味超标
    2020-12-10 01:16

    I got couple of solution for this problem.

    1) binding parent width to textblock width. (im the following case i considered usercontrol as parent).

       
        
            
                
    
                   
        
    
    

    2) other solution is using Grid instead of stackpanel

       
        
            
                
                    
                    
                
                
                
    
                   
        
    
    

提交回复
热议问题