Properties Order in Margin
If I Have Such String in Xaml: Storyboard. Targetproperty="Margin" From="1,2,3,4" To="0,0,0,0" What Is Top Bottom Right and Left? 1- Right 2- Top 3- Left 4...
If I have such string in XAML:
Storyboard.TargetProperty="Margin" From="1,2,3,4" To="0,0,0,0"
What is Top Bottom Right and Left? 1- right 2- top 3- left 4 - bottom
Is that right?
4 Answers
Margin="1,2,3,4"
- Left,
- Top,
- Right,
- Bottom
It is also possible to specify just two sizes like this:
Margin="1,2"
- Left AND right
- Top AND bottom
Finally you can specify a single size:
Margin="1"
- used for all sides
The order is the same as in WinForms.
There are three unique situations:
- 4 numbers, e.g.
Margin="a,b,c,d". - 2 numbers, e.g.
Margin="a,b". - 1 number, e.g.
Margin="a".
Must Read
4 Numbers
If there are 4 numbers, then its left, top, right, bottom (a clockwise circle starting from the middle left margin). First number is always the "West" like "WPF":
<object Margin="left,top,right,bottom"/>
Example: if we use Margin="10,20,30,40" it generates: