How do I space out the child elements of a StackPanel?

前端 未结 11 2118
长情又很酷
长情又很酷 2020-12-04 06:11

Given a StackPanel:


  Apple
  Banana
  

        
11条回答
  •  借酒劲吻你
    2020-12-04 07:07

    Use Margin or Padding, applied to the scope within the container:

    
        
            
         
        
        
        
    
    

    EDIT: In case you would want to re-use the margin between two containers, you can convert the margin value to a resource in an outer scope, f.e.

    
        0,10,0,0
    
    

    and then refer to this value in the inner scope

    
        
    
    

提交回复
热议问题