Why does XAML Margin not follow CSS norm?

独自空忆成欢 提交于 2019-12-22 01:34:06

问题


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?


回答1:


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).




回答2:


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.



来源:https://stackoverflow.com/questions/520422/why-does-xaml-margin-not-follow-css-norm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!