# Application

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-diagnostics/diagnostics/controls/struct-application/

**struct** · [`ferroui-diagnostics`](/docs/0.5.0/api/ferroui-diagnostics/) · v0.5.0

```rust
struct Application
```

The application DevTools is attached to, as the root of its trees: the windows of the
application, and the members of the application that DevTools shows. It closes when the
application exits.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L26)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`requested_theme_variant_property`](#function-requested_theme_variant_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`closed`](#function-closed)
- [`as_closeable`](#function-as_closeable)
- [`as_disposable`](#function-as_disposable)
- [`instance`](#function-instance)
- [`data_context`](#function-data_context)
- [`data_templates`](#function-data_templates)
- [`input_manager`](#function-input_manager)
- [`resources`](#function-resources)
- [`styles`](#function-styles)
- [`application_lifetime`](#function-application_lifetime)
- [`name`](#function-name)
- [`renderer_root`](#function-renderer_root)
- [`requested_theme_variant`](#function-requested_theme_variant)
- [`set_requested_theme_variant`](#function-set_requested_theme_variant)
- [`dispose`](#function-dispose)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L35)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<Application>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L35)

<a id="function-requested_theme_variant_property"></a>

### requested_theme_variant_property

```rust
fn requested_theme_variant_property() -> &'static StyledProperty<Option<ThemeVariant>>
```

Defines the `requested_theme_variant` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L38)

<a id="function-construct"></a>

### construct

```rust
fn construct(group: Rc<dyn IDevToolsTopLevelGroup>, application: Ref<ferroui_controls::Application>) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L110)

<a id="function-new"></a>

### new

```rust
fn new(group: Rc<dyn IDevToolsTopLevelGroup>, application: Ref<ferroui_controls::Application>) -> Ref<Self>
```

C# `new Application(ClassicDesktopStyleApplicationLifetimeTopLevelGroup group,
Application application)`: `group` is the
`ClassicDesktopStyleApplicationLifetimeTopLevelGroup` of the lifetime of `application`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L130)

<a id="function-closed"></a>

### closed

```rust
fn closed(self: &Self, handler: impl Fn() -> () + 'static) -> Rc<dyn IDisposable>
```

Raised when the application exits. Disposing the returned handle unsubscribes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L135)

<a id="function-as_closeable"></a>

### as_closeable

```rust
fn as_closeable(this: Ref<Self>) -> Rc<dyn ICloseable>
```

The application as `ICloseable` (the class implements it in the original).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L152)

<a id="function-as_disposable"></a>

### as_disposable

```rust
fn as_disposable(this: Ref<Self>) -> Rc<dyn IDisposable>
```

The application as `IDisposable` (the class implements it in the original).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L157)

<a id="function-instance"></a>

### instance

```rust
fn instance(self: &Self) -> Ref<ferroui_controls::Application>
```

The application DevTools is attached to.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L162)

<a id="function-data_context"></a>

### data_context

```rust
fn data_context(self: &Self) -> Option<BoxedValue>
```

The data context of the application.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L167)

<a id="function-data_templates"></a>

### data_templates

```rust
fn data_templates(self: &Self) -> DataTemplates
```

Gets or sets the application's global data templates.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L172)

<a id="function-input_manager"></a>

### input_manager

```rust
fn input_manager(self: &Self) -> Option<Rc<InputManager>>
```

Gets the application's input manager.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L177)

<a id="function-resources"></a>

### resources

```rust
fn resources(self: &Self) -> Ref<ResourceDictionary>
```

Gets the application's global resource dictionary.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L182)

<a id="function-styles"></a>

### styles

```rust
fn styles(self: &Self) -> Ref<Styles>
```

Gets the application's global styles.

Global styles apply to all windows in the application.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L189)

<a id="function-application_lifetime"></a>

### application_lifetime

```rust
fn application_lifetime(self: &Self) -> Option<Rc<dyn IApplicationLifetime>>
```

Application lifetime, use it for things like setting the main window and exiting the app from code
Currently supported lifetimes are:
- `IClassicDesktopStyleApplicationLifetime`
- `ISingleViewApplicationLifetime`
- `IControlledApplicationLifetime`

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L198)

<a id="function-name"></a>

### name

```rust
fn name(self: &Self) -> Option<String>
```

Application name to be used for various platform-specific purposes

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L203)

<a id="function-renderer_root"></a>

### renderer_root

```rust
fn renderer_root(self: &Self) -> Option<Rc<dyn ITopLevelRenderer>>
```

Gets the renderer of the root of the visual tree of the application: the renderer of
its main window, or of the top level of its main view.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L209)

<a id="function-requested_theme_variant"></a>

### requested_theme_variant

```rust
fn requested_theme_variant(self: &Self) -> Option<ThemeVariant>
```

The theme variant requested for the application (`ThemeVariantScope.RequestedThemeVariant`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L214)

<a id="function-set_requested_theme_variant"></a>

### set_requested_theme_variant

```rust
fn set_requested_theme_variant(self: &Self, value: Option<ThemeVariant>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L218)

<a id="function-dispose"></a>

### dispose

```rust
fn dispose(self: &Self)
```

`Dispose`: stops following the changes of the application.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/controls/application.rs#L223)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<Application>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
