Class Selectors
Extension methods for Selector.
public static class Selectors
- Inheritance
-
Selectors
- Inherited Members
Methods
Child(Selector)
Returns a selector which matches a previous selector's child.
public static Selector Child(this Selector previous)
Parameters
previous
SelectorThe previous selector.
Returns
- Selector
The selector.
Class(Selector?, string)
Returns a selector which matches a control's style class.
public static Selector Class(this Selector? previous, string name)
Parameters
Returns
- Selector
The selector.
Descendant(Selector?)
Returns a selector which matches a descendant of a previous selector.
public static Selector Descendant(this Selector? previous)
Parameters
previous
SelectorThe previous selector.
Returns
- Selector
The selector.
Is(Selector?, Type)
Returns a selector which matches a type or a derived type.
public static Selector Is(this Selector? previous, Type type)
Parameters
Returns
- Selector
The selector.
Is<T>(Selector?)
Returns a selector which matches a type or a derived type.
public static Selector Is<T>(this Selector? previous) where T : StyledElement
Parameters
previous
SelectorThe previous selector.
Returns
- Selector
The selector.
Type Parameters
T
The type.
Name(Selector?, string)
Returns a selector which matches a control's Name.
public static Selector Name(this Selector? previous, string name)
Parameters
Returns
- Selector
The selector.
Nesting(Selector?)
public static Selector Nesting(this Selector? previous)
Parameters
previous
Selector
Returns
Not(Selector?, Selector)
Returns a selector which inverts the results of selector argument.
public static Selector Not(this Selector? previous, Selector argument)
Parameters
Returns
- Selector
The selector.
Not(Selector?, Func<Selector?, Selector>)
Returns a selector which inverts the results of selector argument.
public static Selector Not(this Selector? previous, Func<Selector?, Selector> argument)
Parameters
previous
SelectorThe previous selector.
argument
Func<Selector, Selector>The selector to be not-ed.
Returns
- Selector
The selector.
NthChild(Selector?, int, int)
The :nth-child() pseudo-class matches elements based on their position in a group of siblings.
public static Selector NthChild(this Selector? previous, int step, int offset)
Parameters
Returns
- Selector
The selector.
Remarks
Element indices are 1-based.
NthLastChild(Selector?, int, int)
The :nth-child() pseudo-class matches elements based on their position among a group of siblings, counting from the end.
public static Selector NthLastChild(this Selector? previous, int step, int offset)
Parameters
previous
SelectorPrevious selector.
step
intPosition step.
offset
intInitial index offset, counting from the end.
Returns
- Selector
The selector.
Remarks
Element indices are 1-based.
OfType(Selector?, Type)
Returns a selector which matches a type.
public static Selector OfType(this Selector? previous, Type type)
Parameters
Returns
- Selector
The selector.
OfType<T>(Selector?)
Returns a selector which matches a type.
public static Selector OfType<T>(this Selector? previous) where T : StyledElement
Parameters
previous
SelectorThe previous selector.
Returns
- Selector
The selector.
Type Parameters
T
The type.
Or(params Selector[])
Returns a selector which ORs selectors.
public static Selector Or(params Selector[] selectors)
Parameters
selectors
Selector[]The selectors to be OR'd.
Returns
- Selector
The selector.
Or(IReadOnlyList<Selector>)
Returns a selector which ORs selectors.
public static Selector Or(IReadOnlyList<Selector> selectors)
Parameters
selectors
IReadOnlyList<Selector>The selectors to be OR'd.
Returns
- Selector
The selector.
PropertyEquals(Selector?, AvaloniaProperty, object?)
Returns a selector which matches a control with the specified property value.
public static Selector PropertyEquals(this Selector? previous, AvaloniaProperty property, object? value)
Parameters
previous
SelectorThe previous selector.
property
AvaloniaPropertyThe property.
value
objectThe property value.
Returns
- Selector
The selector.
PropertyEquals<T>(Selector?, AvaloniaProperty<T>, object?)
Returns a selector which matches a control with the specified property value.
public static Selector PropertyEquals<T>(this Selector? previous, AvaloniaProperty<T> property, object? value)
Parameters
previous
SelectorThe previous selector.
property
AvaloniaProperty<T>The property.
value
objectThe property value.
Returns
- Selector
The selector.
Type Parameters
T
The property type.
Template(Selector)
Returns a selector which enters a lookless control's template.
public static Selector Template(this Selector previous)
Parameters
previous
SelectorThe previous selector.
Returns
- Selector
The selector.