StyleKey Property
Gets the type by which the element is styled.
Definition
Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public Type StyleKey { get; }
Public ReadOnly Property StyleKey As Type
Get
abstract StyleKey : Type with get
override StyleKey : Type with get
Property Value
TypeImplements
IStyleable.StyleKeyRemarks
Usually controls are styled by their own type, but there are instances where you want an element to be styled by its base type, e.g. creating SpecialButton that derives from Button and adds extra functionality but is still styled as a regular Button. To change the style for a control class, override the StyleKeyOverride property