TextBlock.Padding Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets a value that indicates the thickness of padding space between the boundaries of the content area and the content displayed by a TextBlock.
Assembly: System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.
<TextBlock Padding="uniform"/> - or - <TextBlock Padding="left&Right,top&Bottom"/> - or - <TextBlock Padding="left,top,right,bottom"/>
XAML Values
Note: |
|---|
In the XAML syntax, you can use a space instead of a comma as the delimiter between values. |
Property Value
Type: System.Windows.ThicknessA Thickness structure that specifies the amount of padding to apply.
Dependency property identifier field: PaddingProperty
In XAML, Padding can be specified in the following ways:
As a single value that specifies uniform space in all directions (Padding="10").
As two values that specify horizontal and vertical dimensions (Padding="10,5").
As four values that represent left, top, right, and bottom padding independently (Padding="5,0,10,20").
For more information, see the Thickness class description.
If a specified padding thickness exceeds the corresponding content area dimension (for example, the sum of the left and right padding widths exceeds the content area width), the thickness of the padding is proportionally reduced to be no greater than the relevant content area dimension.
Note: