Skip to content

StyleSheetExtensions.WithName<T> method

Defines a type-based style rule by style name (Define) and returns the sheet for chaining.

public static StyleSheet WithName<T>(this StyleSheet sheet, string styleName)
where T : Control
parameter description
T Target control type.
sheet Target style sheet.
styleName Style name to resolve.

The style sheet for chaining.

The name is resolved where a control’s own StyleName is, so a rule can point at a style defined further out.