WPF:具有列/行边距/填充的网格? [英] WPF: Grid with column/row margin/padding?

查看:155
本文介绍了WPF:具有列/行边距/填充的网格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我当然可以为WPF Grid中的行或列指定边距和/或填充值添加额外的列空间的东西,但这似乎是一个填充/边距的工作(它会给予很多简单的XAML)。有人从标准Grid派生出来添加这个功能吗?

你可以编写你自己的 GridWithMargin class,继承自 Grid ,并覆盖 ArrangeOverride 方法来应用边距


Is it easily possible to specify a margin and/or padding for rows or columns in a WPF Grid?

I could of course add extra columns to space things out, but this seems like a job for padding/margins (it will give much simplier XAML). Has someone derived from the standard Grid to add this functionality?

解决方案

You could write your own GridWithMargin class, inherited from Grid, and override the ArrangeOverride method to apply the margins

这篇关于WPF:具有列/行边距/填充的网格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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