StyledElement

Inheritance: Animatable AvaloniaUI documentation: StyledElement API

Properties

Properties
Description

name(value: string)

Sets the Name property.

classes(value: string list)

Sets the Classes property.

classes(value: string)

Sets the Classes property.

style(fn: WidgetBuilder<'msg, #IFabAvaloniaObject> -> WidgetBuilder<'msg, #IFabAvaloniaObject>)

Sets the Style property.

contentType(value:TextInputContentType)

Sets the ContentType property.

returnKeyType(value: TextInputReturnKeyType)

Sets the ReturnKeyType property.

multiline(value: bool)

Sets the Multiline property.

lowercase(value: bool)

Sets the Lowercase property.

uppercase(value: bool)

Sets the Uppercase property.

autoCapitalization(value: bool)

Sets the AutoCapitalization property.

isSensitive(value: bool)

Sets the IsSensitive property.

styles(value: string list)

Sets the application styles

themeKey(value: string)

Sets the ThemeKey property. The ThemeKey is used to lookup the ControlTheme from the application styles that is applied to the control.

Events

Properties
Description

onAttachedToLogicalTree(fn: LogicalTreeAttachmentEventArgs -> 'msg)

Raised when the styled element is attached to a rooted logical tree.

onDetachedFromLogicalTree(fn: LogicalTreeAttachmentEventArgs -> 'msg)

Raised when the styled element is detached from a rooted logical tree.

onActualThemeVariantChanged(msg: 'msg)

Raised when the actual theme variant changes.

Usages

let textBlockStyle (this: WidgetBuilder<'msg, IFabTextBlock>) =
    this
        .verticalAlignment(VerticalAlignment.Center)
        .foreground(SolidColorBrush(Colors.Black))
            
TextBlock("Hello Wrold")
    .style(textBlockStyle)

Last updated