When you see Margin attribute in a XAML file of WPF, it has four components. Why is this? The first two components make sense they are offset from top left window, but what is it for the third and fourth components when we have Width and Height?
<Grid>
<Button Content="Button" Height="27" HorizontalAlignment="Left" Margin="29,27,0,0" Name="clickButton" VerticalAlignment="Top" Width="86" Click="clickButton_Click" />
<TextBox Height="27" HorizontalAlignment="Left" Margin="29,90,0,0" Name="textBoxOut" VerticalAlignment="Top" Width="276" />
</Grid>
Margin always has four components: left, top, right and bottom. Two components are just shorthand when top=bottom and left=right. And one component is shorthand when all four components are the same.
Here is good explanation of Margins and Paddings.