Style

Inheritance: AvaloniaObject AvaloniaUI documentation: Style API

Constructors

ConstructorsDescription

Animations()

Creates a Animations widget.

Properties

PropertiesDescription

animation(value: WidgetBuilder<'msg, IFabAnimation>)

Sets the Animations property.

animation(value: WidgetBuilder<'msg, IFabStyle>)

Sets the Animations property.

reference(value: ViewRef

Link a ViewRef to access the direct Style control instance.

Usages

Border(...)
    .animation(
        Animations() {
            (Animation(TimeSpan.FromSeconds(3.)) {
                KeyFrame(Rotate3DTransform.AngleXProperty, 0.).cue(0.)
                KeyFrame(Visual.ZIndexProperty, 4).cue(0.)
                KeyFrame(Rotate3DTransform.AngleXProperty, 90.).cue(0.25)
                KeyFrame(Visual.ZIndexProperty, 1).cue(0.25)
                KeyFrame(Rotate3DTransform.AngleXProperty, 360.).cue(1.)
                KeyFrame(Visual.ZIndexProperty, 4).cue(1.)
            })
                .repeatForever()
        }
    )

Border(...)
    .animation(
        (Animation(TimeSpan.FromSeconds(3.)) {
            KeyFrame(Rotate3DTransform.AngleXProperty, 0.).cue(0.)
            KeyFrame(Visual.ZIndexProperty, 4).cue(0.)
            KeyFrame(Rotate3DTransform.AngleXProperty, 90.).cue(0.25)
            KeyFrame(Visual.ZIndexProperty, 1).cue(0.25)
            KeyFrame(Rotate3DTransform.AngleXProperty, 360.).cue(1.)
            KeyFrame(Visual.ZIndexProperty, 4).cue(1.)
        })
            .repeatForever()
    )

Get access to the underlying Style

let styleRef = ViewRef<Style>()

(Animation(TimeSpan.FromSeconds(3.)) {
    KeyFrame(Rotate3DTransform.AngleXProperty, 0.).cue(0.)
    KeyFrame(Visual.ZIndexProperty, 4).cue(0.)
    KeyFrame(Rotate3DTransform.AngleXProperty, 90.).cue(0.25)
    KeyFrame(Visual.ZIndexProperty, 1).cue(0.25)
    KeyFrame(Rotate3DTransform.AngleXProperty, 360.).cue(1.)
    KeyFrame(Visual.ZIndexProperty, 4).cue(1.)
})
    .repeatForever()
    .reference(styleRef)
    

Last updated