为什么XAML Margin不遵循CSS规范? [英] Why does XAML Margin not follow CSS norm?

查看:109
本文介绍了为什么XAML Margin不遵循CSS规范?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CSS中,保证金顺序为:右上左下

In CSS the margin order is: top right bottom left

在XAML中,保证金顺序为:左上右下

In XAML the margin order is: left top right bottom

WPF团队有没有将其与CSS规范保持一致的原因?

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

推荐答案

我想这是因为WinForms中的边距被声明为left,top,right,bottom.他们可能认为WinForms开发人员将更可能使用WPF,而不是Web上的开发人员.

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.

作为参考,您可以检查构造函数,以了解MSDN上的填充结构(用于Margin属性的类型).

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

这篇关于为什么XAML Margin不遵循CSS规范?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆