StackPanel.Spacing Property


Gets or sets a uniform distance (in pixels) between stacked items. It is applied in the direction of the StackPanel's Orientation.

Equivalent WinUI property: Microsoft.UI.Xaml.Controls.StackPanel.Spacing.

 property double Spacing { double get(); void set(double value); };
double Spacing();

void Spacing(double value);
public double Spacing { get; set; }
var double = stackPanel.spacing;
stackPanel.spacing = double;
Public Property Spacing As Double
<StackPanel Spacing="double"/>

Property Value



The uniform distance (in pixels) between stacked items.

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Applies to