Application

Encapsulates a Avalonia application.

Inheritance: AvaloniaObject AvaloniaUI documentation: Application API

Constructors

Constructors
Description

DesktopApplication(window: WidgetBuilder<'msg, #IFabWindow>)

Creates a DesktopApplication widget with a content widget.

SingleViewApplication(view: WidgetBuilder<'msg, #IFabControl>)

Creates a SingleViewApplication widget with a content widget.

Properties

Properties
Description

name(value: string)

Sets the applications name.

debugOverlays(value:RendererDebugOverlays)

Sets the application debug overlays.

isSystemBarVisible(value: bool)

Sets the application system bar visibility.

displayEdgeToEdge(value: bool)

Sets the application display edge to edge.

systemBarColor(value: Color)

Sets the application system bar color.

reference(value: ViewRef<FabApplication>)

Sets a ViewRef instance to retrieve the Avalonia.Application instance associated to this widget

Events

Properties
Description

onThemeVariantChanged(value: ThemeVariant, fn: ThemeVariant -> 'msg)

Raised when the theme variant changes and

sets the application theme variant.

onThemeVariantChanged(fn: ThemeVariant -> 'msg)

Raised when the application theme variant changed event.

onResourcesChanged(fn: ResourcesChangedEventArgs -> 'msg)

Raised when the resources change.

onUrlsOpened(fn: UrlOpenedEventArgs -> 'msg)

Raised when the application receives urls to open.

onColorValuesChanged(fn: PlatformColorValues -> 'msg)

Raised when current system color values are changed. Including changing of a dark mode and accent colors.

onSafeAreaChanged(fn: Platform.SafeAreaChangedArgs -> 'msg)

Raised when the safe area is changed.

Usages

DesktopApplication(
    Window(
        VStack() {
            TextBlock("Hello World!")
        }
    )
)

SingleViewApplication(
    VStack() {
        TextBlock("Hello World!")
    }
)

Get access to the underlying Application

let applicationRef = ViewRef<FabApplication>()

DesktopApplication(
    Window(
        VStack() {
            TextBlock("Hello World!")
        }
    )
).reference(applicationRef)

SingleViewApplication(
    VStack() {
        TextBlock("Hello World!")
    }
).reference(applicationRef)

Last updated