I have the below XAML which shows some padding under the buttons in the UniformGrid:
<Grid>
<UniformGrid Background="#CCC"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Margin="8,8,8,0">
<Button Height="28"
Margin="5">
OK
</Button>
<Button Height="28"
Margin="5">
Cancel
</Button>
</UniformGrid>
</Grid>
It displays as:

But if I remove one of the buttons, no padding will occur:

How can I remove this padding when 2 buttons are in the XAML?
I have tried the obvious Padding and Margin properties but it remains the same.
Try specifying the number of rows:
UniformGrid will automatically set the number of columns and rows according to the number of elements added to it. Take a look at this post.