为网格中的 UIElement 设置列跨度非常容易。
Grid.SetColumnSpan(extBorder, gridFormular.ColumnDefinitions.Count());
但是如何读取元素的 ColumnSpan?怎么做?
为网格中的 UIElement 设置列跨度非常容易。
Grid.SetColumnSpan(extBorder, gridFormular.ColumnDefinitions.Count());
但是如何读取元素的 ColumnSpan?怎么做?
您可以在列 spanFrameworkElement.GetValue
的依赖属性标识符上使用:
var columnSpan = (int)extBorder.GetValue(Grid.ColumnSpanProperty);
同样的策略适用于检索元素上存在的任何依赖属性的值。
除了使用六字母变量所示的 GetValue(Grid.ColumnSpanProperty) 之外,您还可以使用Grid.GetColumnSpan()。