# TopLevel

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

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

```rust
struct TopLevel
```

Base class for top-level widgets.

This class acts as a base for top level widget. It handles scheduling
layout, styling and rendering as well as tracking the widget's
`client_size`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L58)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`handle_closed`](#function-handle_closed)
- [`handle_resized`](#function-handle_resized)
- [`on_opened`](#function-on_opened)
- [`on_closed`](#function-on_closed)
- [`opened_popups`](#function-opened_popups)
- [`TEMPLATE_PARTS`](#assoc_const-template_parts)
- [`enable_visual_layer_manager_layers`](#function-enable_visual_layer_manager_layers)
- [`client_size_property`](#function-client_size_property)
- [`frame_size_property`](#function-frame_size_property)
- [`transparency_level_hint_property`](#function-transparency_level_hint_property)
- [`actual_transparency_level_property`](#function-actual_transparency_level_property)
- [`transparency_background_fallback_property`](#function-transparency_background_fallback_property)
- [`system_backdrop_property`](#function-system_backdrop_property)
- [`actual_theme_variant_property`](#function-actual_theme_variant_property)
- [`requested_theme_variant_property`](#function-requested_theme_variant_property)
- [`system_bar_color_property`](#function-system_bar_color_property)
- [`auto_safe_area_padding_property`](#function-auto_safe_area_padding_property)
- [`back_requested_event`](#function-back_requested_event)
- [`opened`](#function-opened)
- [`closed`](#function-closed)
- [`scaling_changed`](#function-scaling_changed)
- [`platform_lost_focus`](#function-platform_lost_focus)
- [`platform_deactivated`](#function-platform_deactivated)
- [`platform_position_changed`](#function-platform_position_changed)
- [`client_size`](#function-client_size)
- [`set_client_size`](#function-set_client_size)
- [`frame_size`](#function-frame_size)
- [`set_frame_size`](#function-set_frame_size)
- [`transparency_level_hint`](#function-transparency_level_hint)
- [`set_transparency_level_hint`](#function-set_transparency_level_hint)
- [`actual_transparency_level`](#function-actual_transparency_level)
- [`transparency_background_fallback`](#function-transparency_background_fallback)
- [`set_transparency_background_fallback`](#function-set_transparency_background_fallback)
- [`requested_theme_variant`](#function-requested_theme_variant)
- [`set_requested_theme_variant`](#function-set_requested_theme_variant)
- [`back_requested`](#function-back_requested)
- [`layout_manager`](#function-layout_manager)
- [`try_get_platform_handle`](#function-try_get_platform_handle)
- [`create_platform_impl_binding`](#function-create_platform_impl_binding)
- [`input_root`](#function-input_root)
- [`hit_tester_override`](#function-hit_tester_override)
- [`set_hit_tester_override`](#function-set_hit_tester_override)
- [`renderer_diagnostics`](#function-renderer_diagnostics)
- [`last_pointer_position`](#function-last_pointer_position)
- [`access_key_handler`](#function-access_key_handler)
- [`tests_keyboard_navigation_handler`](#function-tests_keyboard_navigation_handler)
- [`set_system_bar_color`](#function-set_system_bar_color)
- [`get_system_bar_color`](#function-get_system_bar_color)
- [`set_auto_safe_area_padding`](#function-set_auto_safe_area_padding)
- [`get_auto_safe_area_padding`](#function-get_auto_safe_area_padding)
- [`render_scaling`](#function-render_scaling)
- [`storage_provider`](#function-storage_provider)
- [`insets_manager`](#function-insets_manager)
- [`input_pane`](#function-input_pane)
- [`launcher`](#function-launcher)
- [`screens`](#function-screens)
- [`clipboard`](#function-clipboard)
- [`try_get_clipboard`](#function-try_get_clipboard)
- [`focus_manager`](#function-focus_manager)
- [`get_top_level`](#function-get_top_level)
- [`request_platform_inhibition`](#function-request_platform_inhibition)
- [`request_animation_frame`](#function-request_animation_frame)
- [`start_rendering`](#function-start_rendering)
- [`stop_rendering`](#function-stop_rendering)
- [`media_context_key`](#function-media_context_key)
- [`ensure_closed`](#function-ensure_closed)
- [`system_backdrop`](#function-system_backdrop)
- [`set_system_backdrop`](#function-set_system_backdrop)
- [`system_backdrop_target`](#function-system_backdrop_target)
- [`add_opened_popup`](#function-add_opened_popup)
- [`remove_opened_popup`](#function-remove_opened_popup)
- [`as_closeable`](#function-as_closeable)

<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.Controls/top_level.rs#L99)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L99)

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

### handle_closed

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

Handles a closed notification from the platform implementation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L99)

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

### handle_resized

```rust
fn handle_resized(self: &Self, client_size: Size, reason: WindowResizeReason)
```

Handles a resize notification from the platform implementation:
`client_size` is the new client size and `reason` the reason for
the resize.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L99)

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

### on_opened

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

Raises the `Opened` event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L99)

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

### on_closed

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

Raises the `Closed` event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L99)

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

### opened_popups

```rust
fn opened_popups(self: &Self) -> Vec<Ref<crate::primitives::Popup>>
```

The popups that are currently open directly in this top level,
in the order they were opened.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L99)

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

### TEMPLATE_PARTS

```rust
const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
```

The named parts expected in the control template.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L298)

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

### enable_visual_layer_manager_layers

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

Enables the overlay, popup overlay and text selector layers of the
layer manager of the control template (private protected upstream:
for the top-levels that host their popups and overlays themselves).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L315)

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

### client_size_property

```rust
fn client_size_property() -> &'static DirectProperty<TopLevel, Size>
```

Defines the `ClientSize` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L324)

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

### frame_size_property

```rust
fn frame_size_property() -> &'static DirectProperty<TopLevel, Option<Size>>
```

Defines the `FrameSize` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L324)

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

### transparency_level_hint_property

```rust
fn transparency_level_hint_property() -> &'static StyledProperty<WindowTransparencyLevelCollection>
```

Defines the `TransparencyLevelHint` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L324)

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

### actual_transparency_level_property

```rust
fn actual_transparency_level_property() -> &'static DirectProperty<TopLevel, WindowTransparencyLevel>
```

Defines the `ActualTransparencyLevel` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L324)

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

### transparency_background_fallback_property

```rust
fn transparency_background_fallback_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
```

Defines the `TransparencyBackgroundFallback` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L324)

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

### system_backdrop_property

```rust
fn system_backdrop_property() -> &'static StyledProperty<Option<Ref<crate::media::SystemBackdrop>>>
```

Defines the `SystemBackdrop` property (WinUI `Window.SystemBackdrop`,
`Popup.SystemBackdrop`; winui-materials.md): the system backdrop
drawn behind the content of the top level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L324)

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

### actual_theme_variant_property

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

Defines the `ActualThemeVariant` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L381)

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

### requested_theme_variant_property

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

Defines the `RequestedThemeVariant` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L386)

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

### system_bar_color_property

```rust
fn system_bar_color_property() -> &'static AttachedProperty<Option<Ref<SolidColorBrush>>>
```

Defines the SystemBarColor attached property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L390)

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

### auto_safe_area_padding_property

```rust
fn auto_safe_area_padding_property() -> &'static AttachedProperty<bool>
```

Defines the AutoSafeAreaPadding attached property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L400)

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

### back_requested_event

```rust
fn back_requested_event() -> &'static RoutedEvent<RoutedEventArgs>
```

Defines the `BackRequested` event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L407)

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

### opened

```rust
fn opened(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
```

Fired when the window is opened.

Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L831)

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

### closed

```rust
fn closed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
```

Fired when the window is closed.

Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L839)

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

### scaling_changed

```rust
fn scaling_changed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
```

Fired when the top-level's scaling changes.

Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L847)

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

### platform_lost_focus

```rust
fn platform_lost_focus(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
```

Adds a handler to the lost-focus notification of the platform
implementation (C# `PlatformImpl.LostFocus += handler`); it runs after
the top-level's own handling.

The callbacks of a platform implementation hold a single function,
so handlers that come and go (an open popup watching its parent) are
kept in a list of the top-level instead of being chained onto the
callback, where a removed handler would stay behind.

Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L862)

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

### platform_deactivated

```rust
fn platform_deactivated(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
```

Adds a handler to the deactivated notification of a window platform
implementation (C# `impl.Deactivated += handler`); see
`platform_lost_focus`.

Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L872)

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

### platform_position_changed

```rust
fn platform_position_changed(self: &Self, handler: impl Fn(PixelPoint) -> () + 'static) -> Subscription
```

Adds a handler to the position-changed notification of a window
platform implementation (C# `impl.PositionChanged += handler`); see
`platform_lost_focus`.

Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L882)

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

### client_size

```rust
fn client_size(self: &Self) -> Size
```

The client size of the window.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L905)

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

### set_client_size

```rust
fn set_client_size(self: &Self, value: Size)
```

Sets the client size of the window (protected upstream: for derived
classes).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L911)

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

### frame_size

```rust
fn frame_size(self: &Self) -> Option<Size>
```

The total size of the window.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L916)

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

### set_frame_size

```rust
fn set_frame_size(self: &Self, value: Option<Size>)
```

Sets the total size of the window (protected upstream: for derived
classes).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L922)

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

### transparency_level_hint

```rust
fn transparency_level_hint(self: &Self) -> WindowTransparencyLevelCollection
```

The transparency levels that the top-level should use when possible.
Accepts multiple values which are applied in a fallback order. For
instance, with "Mica, Blur" Mica will be applied only on platforms
where it is possible, and Blur will be used on the rest of them.
Default value is an empty collection or "None".

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L931)

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

### set_transparency_level_hint

```rust
fn set_transparency_level_hint(self: &Self, value: WindowTransparencyLevelCollection)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L935)

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

### actual_transparency_level

```rust
fn actual_transparency_level(self: &Self) -> WindowTransparencyLevel
```

The achieved transparency level that the platform was able to
provide.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L941)

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

### transparency_background_fallback

```rust
fn transparency_background_fallback(self: &Self) -> Option<Rc<dyn IBrush>>
```

The brush that transparency will blend with when transparency is not
supported. By default this is a solid white brush.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L951)

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

### set_transparency_background_fallback

```rust
fn set_transparency_background_fallback(self: &Self, value: Option<Rc<dyn IBrush>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L955)

<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 top-level and its descendants.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L960)

<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.Controls/top_level.rs#L964)

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

### back_requested

```rust
fn back_requested(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
```

Occurs when physical Back Button is pressed or a back navigation has
been requested.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L970)

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

### layout_manager

```rust
fn layout_manager(self: &Self) -> Rc<LayoutManager>
```

The layout manager of the top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L975)

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

### try_get_platform_handle

```rust
fn try_get_platform_handle(self: &Self) -> Option<Rc<dyn IPlatformHandle>>
```

Tries to get the platform handle for the top-level-derived control.

Returns the handle describing the window, or `None` if the handle
could not be retrieved.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L989)

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

### create_platform_impl_binding

```rust
fn create_platform_impl_binding<T: ferroui_base::PropertyValue>(self: &Self, property: &'static StyledProperty<T>, on_value: impl Fn(T) -> () + 'static)
```

Calls `on_value` with the value of `property` now and whenever the
property changes, for as long as the top-level has a platform
implementation (private protected upstream: for derived classes).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L996)

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

### input_root

```rust
fn input_root(self: &Self) -> Rc<dyn IInputRoot>
```

The input root of the top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1030)

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

### hit_tester_override

```rust
fn hit_tester_override(self: &Self) -> Option<Rc<dyn IHitTester>>
```

The hit tester used instead of the renderer's. This is here purely
for unit tests that don't want to set up a proper hit-testable
visual tree.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1042)

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

### set_hit_tester_override

```rust
fn set_hit_tester_override(self: &Self, value: Option<Rc<dyn IHitTester>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1046)

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

### renderer_diagnostics

```rust
fn renderer_diagnostics(self: &Self) -> Rc<RendererDiagnostics>
```

A value controlling whether the renderer should draw specific
diagnostics.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1052)

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

### last_pointer_position

```rust
fn last_pointer_position(self: &Self) -> Option<PixelPoint>
```

The last known position of the pointer, in screen coordinates.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1057)

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

### access_key_handler

```rust
fn access_key_handler(self: &Self) -> Option<Rc<dyn IAccessKeyHandler>>
```

The access key handler for the window.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1062)

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

### tests_keyboard_navigation_handler

```rust
fn tests_keyboard_navigation_handler(self: &Self) -> Option<Rc<dyn IKeyboardNavigationHandler>>
```

The keyboard navigation handler of the window (for unit tests).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1067)

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

### set_system_bar_color

```rust
fn set_system_bar_color(control: &Control, color: Option<Ref<SolidColorBrush>>)
```

Helper for setting the color of the platform's system bars.
`control` is the main view attached to the top-level, or the
top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1074)

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

### get_system_bar_color

```rust
fn get_system_bar_color(control: &Control) -> Option<Ref<SolidColorBrush>>
```

Helper for getting the color of the platform's system bars.
`control` is the main view attached to the top-level, or the
top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1081)

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

### set_auto_safe_area_padding

```rust
fn set_auto_safe_area_padding(control: &Control, value: bool)
```

Enables or disables whenever the top-level should automatically
adjust paddings depending on the safe area. `control` is the main
view attached to the top-level, or the top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1088)

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

### get_auto_safe_area_padding

```rust
fn get_auto_safe_area_padding(control: &Control) -> bool
```

Gets if auto safe area padding is enabled. `control` is the main
view attached to the top-level, or the top-level.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1094)

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

### render_scaling

```rust
fn render_scaling(self: &Self) -> f64
```

The scaling factor to use in rendering.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1099)

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

### storage_provider

```rust
fn storage_provider(self: &Self) -> Rc<dyn ferroui_base::platform::storage::IStorageProvider>
```

File System storage service used for file pickers and bookmarks:
the provider of the registered storage provider factory, else the
one of the platform, else one without pickers. The provider is
created on first use and kept.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1113)

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

### insets_manager

```rust
fn insets_manager(self: &Self) -> Option<Rc<dyn IInsetsManager>>
```

The insets manager of the platform, if it has one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1131)

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

### input_pane

```rust
fn input_pane(self: &Self) -> Option<Rc<dyn IInputPane>>
```

The input pane of the platform, if it has one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1136)

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

### launcher

```rust
fn launcher(self: &Self) -> Rc<dyn ferroui_base::platform::storage::ILauncher>
```

The launcher of the platform: starts the default app associated
with a file or a URI. A launcher that launches nothing when the
platform has none.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1143)

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

### screens

```rust
fn screens(self: &Self) -> Option<Rc<Screens>>
```

The platform screens implementation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1150)

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

### clipboard

```rust
fn clipboard(self: &Self) -> Option<Rc<dyn IClipboard>>
```

The platform's clipboard implementation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1160)

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

### try_get_clipboard

```rust
fn try_get_clipboard(self: &Self, type_: ClipboardType) -> Option<Rc<dyn IClipboard>>
```

Gets the platform's clipboard of the specified type, or `None` if
the platform doesn't provide it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1166)

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

### focus_manager

```rust
fn focus_manager(self: &Self) -> Rc<FocusManager>
```

The focus manager of the root.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1179)

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

### get_top_level

```rust
fn get_top_level(visual: Option<&Visual>) -> Option<Ref<TopLevel>>
```

Gets the top-level in which the given visual is hosted.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1190)

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

### request_platform_inhibition

```rust
fn request_platform_inhibition(self: &Self, type_: PlatformInhibitionType, reason: &str) -> JoinHandle<Rc<dyn IDisposable>>
```

Requests a `PlatformInhibitionType` to be inhibited. The behavior
remains inhibited until the returned value is disposed. The
available set of `PlatformInhibitionType`s depends on the platform.
If a behavior is inhibited on a platform where this type is not
supported the request will have no effect.

Like the asynchronous method of the reference, the request is sent to
the platform before this returns; the returned handle ends, in a
dispatcher job unless the platform completed at once, when the
platform has applied it. Disposing the result starts the request
that lifts the inhibition and returns without waiting for the
platform to complete it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1214)

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

### request_animation_frame

```rust
fn request_animation_frame(self: &Self, action: impl FnOnce(ferroui_base::animation::SignedDuration) -> () + 'static)
```

Enqueues a callback to be called on the next animation tick.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1240)

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

### start_rendering

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

Registers the top-level with the media context, which starts its
renderer (private protected upstream: for derived classes).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1282)

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

### stop_rendering

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

Unregisters the top-level from the media context, which stops its
renderer (private protected upstream: for derived classes).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1289)

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

### media_context_key

```rust
fn media_context_key(self: &Self) -> usize
```

The key that identifies the top-level in the media context.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1294)

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

### ensure_closed

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

Runs the top level teardown exactly once, no matter whether it was
initiated by the platform via the closed notification or by a
managed dispose (private protected upstream: for derived classes).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1301)

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

### system_backdrop

```rust
fn system_backdrop(self: &Self) -> Option<Ref<crate::media::SystemBackdrop>>
```

`SystemBackdrop`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1348)

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

### set_system_backdrop

```rust
fn set_system_backdrop(self: &Self, value: Option<Ref<crate::media::SystemBackdrop>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1352)

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

### system_backdrop_target

```rust
fn system_backdrop_target(self: &Self) -> Rc<crate::media::TopLevelBackdropTarget>
```

The top level as the target of system backdrops.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1357)

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

### add_opened_popup

```rust
fn add_opened_popup(self: &Self, popup: &Ref<crate::primitives::Popup>)
```

Records a popup opened directly in this top level (internal
upstream).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1433)

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

### remove_opened_popup

```rust
fn remove_opened_popup(self: &Self, popup: &Ref<crate::primitives::Popup>)
```

Forgets a popup opened directly in this top level (internal
upstream).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1439)

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

### as_closeable

```rust
fn as_closeable(self: &Self) -> Rc<dyn ferroui_base::input::ICloseable>
```

The top-level as something that tells when it has been closed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/top_level.rs#L1508)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ContentControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-contentcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`TopLevelImplExt`](/docs/0.5.0/api/ferroui-controls/trait-toplevelimplext/)
- `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`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<TopLevel>`](/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/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`ContentControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-contentcontrolimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`TopLevelImpl`](/docs/0.5.0/api/ferroui-controls/trait-toplevelimpl/)
- `Drop`

## Availability

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