Skip to content

ElementExtensions.Center<T> method

Centers the element horizontally and vertically.

public static T Center<T>(this T element)
where T : FrameworkElement
parameter description
T Visual type.
element Target element.

The element for chaining.

Sets: FrameworkElement.HorizontalAlignment, FrameworkElement.VerticalAlignment