# Application

**Inheritance:** [AvaloniaObject](https://reference.avaloniaui.net/api/Avalonia/AvaloniaObject/)\
AvaloniaUI **documentation:** Application [API](https://reference.avaloniaui.net/api/Avalonia/Application/)

### 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) | <p>Raised when the theme variant changes and</p><p>sets the application theme variant.</p>                |
| 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

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

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

```

#### Get access to the underlying Application

```fsharp
let applicationRef = ViewRef<FabApplication>()

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.fabulous.dev/avalonia/application.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
