tags:

views:

434

answers:

2

In CSS the margin order is: top right bottom left

In XAML the margin order is: left top right bottom

Is there a reason why the WPF team didn't align this to the CSS norm?

+5  A: 

They're not aligning to CSS norms - they're aligning with the way that Microsoft has done UI APIs in the past. I can't speak for WinForms, but in MFC coordinates are specified in the order of LTRB.

17 of 26
MFC predates CSS, +1.
Pop Catalin
+8  A: 

I imagine this is because margins in WinForms were declared as left, top, right, bottom. They likely thought it would be more likely to have WinForms developers move on to WPF rather than those from the web.

For reference you can check the constructor for the Padding structure on MSDN (the type used for the Margin property).

Richard C. McGuire
Correct ! :) in Winforms the serialization of a Margin value as a string is done left top right bottom, you beat me to it.
Pop Catalin