문제

It's really easy to set column span for an UIElement in a grid.

Grid.SetColumnSpan(extBorder, gridFormular.ColumnDefinitions.Count());

but what's about reading an element's ColumnSpan? How to do that?

도움이 되었습니까?

해결책

You can use FrameworkElement.GetValue on the dependency property identifier for the column span:

var columnSpan = (int)extBorder.GetValue(Grid.ColumnSpanProperty);

This same strategy works for retrieving the value of any dependency property which exists on the element.

다른 팁

Besides of using GetValue(Grid.ColumnSpanProperty) as shown by sixlettervariables, you also can use Grid.GetColumnSpan().

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top