Skip to content

ControlExtensions.WithTheme<T> method

Registers a theme callback.

public static T WithTheme<T>(this T element, Action<Theme, T> apply, bool invokeImmediately = true)
where T : FrameworkElement
parameter description
T Element type.
element Target element.
apply Callback invoked with the current theme and the element whenever the theme changes.
invokeImmediately Whether to invoke the callback immediately with the current theme as well.

The element for chaining.