IStyle.

TryAttach(IStyleable, IStyleHost?) Method

Summary

Attaches the style and any child styles to a control if the style's selector matches.
Namespace
Avalonia.Styling
Containing Type
IStyle

Syntax

SelectorMatchResult TryAttach(IStyleable target, IStyleHost? host)

Parameters

Name Type Description
target IStyleable The control to attach to.
host IStyleHost? The element that hosts the style.

Return Value

Type Description
SelectorMatchResult A SelectorMatchResult describing how the style matches the control.