Skip to content

UIElement.Triggers property

Gets or sets the conditional values owned by this element; the list is snapshotted and validated on assignment, so assign a new list to change the set.

public IReadOnlyList<ElementTrigger>? Triggers { get; set; }

While a trigger’s condition property equals its value, its setters apply above style values; leaving the condition removes them, revealing whatever is underneath. Later triggers win for the same target property. Style state triggers remain in the Style slot, so these values keep their independent, higher-priority ElementTrigger slot on controls as well as non-control elements.