# Window

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

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

```rust
struct Window
```

A top-level window.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`handle_closing`](#function-handle_closing)
- [`on_closing`](#function-on_closing)
- [`size_to_content_property`](#function-size_to_content_property)
- [`extend_client_area_to_decorations_hint_property`](#function-extend_client_area_to_decorations_hint_property)
- [`extend_client_area_title_bar_height_hint_property`](#function-extend_client_area_title_bar_height_hint_property)
- [`is_extended_into_window_decorations_property`](#function-is_extended_into_window_decorations_property)
- [`window_decoration_margin_property`](#function-window_decoration_margin_property)
- [`off_screen_margin_property`](#function-off_screen_margin_property)
- [`window_decorations_property`](#function-window_decorations_property)
- [`window_decorations_theme_property`](#function-window_decorations_theme_property)
- [`show_activated_property`](#function-show_activated_property)
- [`show_in_taskbar_property`](#function-show_in_taskbar_property)
- [`closing_behavior_property`](#function-closing_behavior_property)
- [`window_state_property`](#function-window_state_property)
- [`title_property`](#function-title_property)
- [`icon_property`](#function-icon_property)
- [`window_startup_location_property`](#function-window_startup_location_property)
- [`can_resize_property`](#function-can_resize_property)
- [`can_minimize_property`](#function-can_minimize_property)
- [`can_maximize_property`](#function-can_maximize_property)
- [`window_closed_event`](#function-window_closed_event)
- [`window_opened_event`](#function-window_opened_event)
- [`new`](#function-new)
- [`owned_windows`](#function-owned_windows)
- [`size_to_content`](#function-size_to_content)
- [`set_size_to_content`](#function-set_size_to_content)
- [`title`](#function-title)
- [`set_title`](#function-set_title)
- [`extend_client_area_to_decorations_hint`](#function-extend_client_area_to_decorations_hint)
- [`set_extend_client_area_to_decorations_hint`](#function-set_extend_client_area_to_decorations_hint)
- [`extend_client_area_title_bar_height_hint`](#function-extend_client_area_title_bar_height_hint)
- [`set_extend_client_area_title_bar_height_hint`](#function-set_extend_client_area_title_bar_height_hint)
- [`is_extended_into_window_decorations`](#function-is_extended_into_window_decorations)
- [`window_decoration_margin`](#function-window_decoration_margin)
- [`caption_button_insets`](#function-caption_button_insets)
- [`off_screen_margin`](#function-off_screen_margin)
- [`window_decorations`](#function-window_decorations)
- [`set_window_decorations`](#function-set_window_decorations)
- [`window_decorations_theme`](#function-window_decorations_theme)
- [`set_window_decorations_theme`](#function-set_window_decorations_theme)
- [`system_decorations`](#function-system_decorations)
- [`set_system_decorations`](#function-set_system_decorations)
- [`show_activated`](#function-show_activated)
- [`set_show_activated`](#function-set_show_activated)
- [`show_in_taskbar`](#function-show_in_taskbar)
- [`set_show_in_taskbar`](#function-set_show_in_taskbar)
- [`closing_behavior`](#function-closing_behavior)
- [`set_closing_behavior`](#function-set_closing_behavior)
- [`window_state`](#function-window_state)
- [`set_window_state`](#function-set_window_state)
- [`can_resize`](#function-can_resize)
- [`set_can_resize`](#function-set_can_resize)
- [`can_minimize`](#function-can_minimize)
- [`set_can_minimize`](#function-set_can_minimize)
- [`can_maximize`](#function-can_maximize)
- [`set_can_maximize`](#function-set_can_maximize)
- [`icon`](#function-icon)
- [`set_icon`](#function-set_icon)
- [`window_startup_location`](#function-window_startup_location)
- [`set_window_startup_location`](#function-set_window_startup_location)
- [`position`](#function-position)
- [`set_position`](#function-set_position)
- [`is_dialog`](#function-is_dialog)
- [`begin_move_drag`](#function-begin_move_drag)
- [`begin_resize_drag`](#function-begin_resize_drag)
- [`closing`](#function-closing)
- [`close`](#function-close)
- [`close_with_result`](#function-close_with_result)
- [`close_core`](#function-close_core)
- [`show_with_owner`](#function-show_with_owner)
- [`show_dialog`](#function-show_dialog)
- [`show_dialog_typed`](#function-show_dialog_typed)
- [`show_dialog_task`](#function-show_dialog_task)
- [`show_dialog_typed_task`](#function-show_dialog_typed_task)
- [`sort_windows_by_z_order`](#function-sort_windows_by_z_order)

<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/window.rs#L73)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### handle_closing

```rust
fn handle_closing(self: &Self, reason: WindowCloseReason) -> bool
```

Handles a closing notification from the platform implementation.
Returns true if closing is cancelled, otherwise false. `reason`
is the reason the window is closing.

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

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

### on_closing

```rust
fn on_closing(self: &Self, e: &WindowClosingEventArgs)
```

Raises the `Closing` event.

A type that derives from `Window` may override this member. The
override must call the base implementation if the `Closing`
event needs to be raised.

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

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

### size_to_content_property

```rust
fn size_to_content_property() -> &'static StyledProperty<SizeToContent>
```

Defines the `SizeToContent` property.

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

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

### extend_client_area_to_decorations_hint_property

```rust
fn extend_client_area_to_decorations_hint_property() -> &'static StyledProperty<bool>
```

Defines the `ExtendClientAreaToDecorationsHint` property.

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

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

### extend_client_area_title_bar_height_hint_property

```rust
fn extend_client_area_title_bar_height_hint_property() -> &'static StyledProperty<f64>
```

Defines the `ExtendClientAreaTitleBarHeightHint` property.

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

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

### is_extended_into_window_decorations_property

```rust
fn is_extended_into_window_decorations_property() -> &'static DirectProperty<Window, bool>
```

Defines the `IsExtendedIntoWindowDecorations` property.

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

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

### window_decoration_margin_property

```rust
fn window_decoration_margin_property() -> &'static DirectProperty<Window, Thickness>
```

Defines the `WindowDecorationMargin` property.

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

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

### off_screen_margin_property

```rust
fn off_screen_margin_property() -> &'static DirectProperty<Window, Thickness>
```

Defines the `OffScreenMargin` property.

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

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

### window_decorations_property

```rust
fn window_decorations_property() -> &'static StyledProperty<WindowDecorations>
```

Defines the `WindowDecorations` property.

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

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

### window_decorations_theme_property

```rust
fn window_decorations_theme_property() -> &'static StyledProperty<Option<Ref<ControlTheme>>>
```

Defines the `WindowDecorationsTheme` property.

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

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

### show_activated_property

```rust
fn show_activated_property() -> &'static StyledProperty<bool>
```

Defines the `ShowActivated` property.

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

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

### show_in_taskbar_property

```rust
fn show_in_taskbar_property() -> &'static StyledProperty<bool>
```

Enables or disables the taskbar icon.

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

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

### closing_behavior_property

```rust
fn closing_behavior_property() -> &'static StyledProperty<WindowClosingBehavior>
```

Defines the `ClosingBehavior` property.

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

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

### window_state_property

```rust
fn window_state_property() -> &'static DirectProperty<Window, WindowState>
```

Represents the currently effective window state (normal,
minimized, maximized).

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

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

### title_property

```rust
fn title_property() -> &'static StyledProperty<Option<String>>
```

Defines the `Title` property.

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

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

### icon_property

```rust
fn icon_property() -> &'static StyledProperty<Option<Rc<WindowIcon>>>
```

Defines the `Icon` property.

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

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

### window_startup_location_property

```rust
fn window_startup_location_property() -> &'static StyledProperty<WindowStartupLocation>
```

Defines the `WindowStartupLocation` property.

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

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

### can_resize_property

```rust
fn can_resize_property() -> &'static StyledProperty<bool>
```

Defines the `CanResize` property.

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

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

### can_minimize_property

```rust
fn can_minimize_property() -> &'static StyledProperty<bool>
```

Defines the `CanMinimize` property.

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

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

### can_maximize_property

```rust
fn can_maximize_property() -> &'static StyledProperty<bool>
```

Defines the `CanMaximize` property.

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

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

### window_closed_event

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

Routed event that can be used for global tracking of window
destruction.

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

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

### window_opened_event

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

Routed event that can be used for global tracking of opening
windows.

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

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

### new

```rust
fn new() -> Ref<Self>
```

Creates a window over a window of the windowing platform.
## Panics
Panics when no windowing platform is registered.

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

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

### owned_windows

```rust
fn owned_windows(self: &Self) -> Vec<Ref<Window>>
```

The child windows owned by this window.

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

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

### size_to_content

```rust
fn size_to_content(self: &Self) -> SizeToContent
```

A value indicating how the window will size itself to fit its
content.

If the value is other than `SizeToContent::MANUAL`, it is
automatically set to `SizeToContent::MANUAL` if a user resizes the
window by using the resize grip or dragging the border.

NOTE: Because of a limitation of X11, the value will be reset on X11
to `SizeToContent::MANUAL` on any resize - including the resize
that happens when the window is first shown. This is because X11
resize notifications are asynchronous and there is no way to know
whether a resize came from the user or the layout system. To avoid
this, consider setting `CanResize` to false, which will disable user
resizing of the window.

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

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

### set_size_to_content

```rust
fn set_size_to_content(self: &Self, value: SizeToContent)
```



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

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

### title

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

The title of the window.

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

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

### set_title

```rust
fn set_title(self: &Self, value: Option<String>)
```



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

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

### extend_client_area_to_decorations_hint

```rust
fn extend_client_area_to_decorations_hint(self: &Self) -> bool
```

Whether the client area is extended into the window decorations
(chrome or border).

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

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

### set_extend_client_area_to_decorations_hint

```rust
fn set_extend_client_area_to_decorations_hint(self: &Self, value: bool)
```



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

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

### extend_client_area_title_bar_height_hint

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

The title bar height hint for when the client area is extended. A
value of -1 will cause the title bar to be auto sized to the OS
default. Any other positive value will cause the title bar to assume
that height.

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

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

### set_extend_client_area_title_bar_height_hint

```rust
fn set_extend_client_area_title_bar_height_hint(self: &Self, value: f64)
```



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

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

### is_extended_into_window_decorations

```rust
fn is_extended_into_window_decorations(self: &Self) -> bool
```

Whether the client area is extended into the window decorations.

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

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

### window_decoration_margin

```rust
fn window_decoration_margin(self: &Self) -> Thickness
```

The thickness around the window that is used by borders and the
title bar.

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

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

### caption_button_insets

```rust
fn caption_button_insets(self: &Self) -> Thickness
```

The room the caption buttons take at the left and the right of the title bar while the
client area is extended into the decorations: the traffic lights of macOS at the left, the
caption buttons the toolkit draws (Windows, Linux) at the right; zero otherwise. Not in
upstream: the insets of WinUI's `AppWindowTitleBar` (`LeftInset`, `RightInset`), which a
`TitleBar` leaves free.

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

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

### off_screen_margin

```rust
fn off_screen_margin(self: &Self) -> Thickness
```

The window margin that is hidden off the screen area. This is
generally only the case on Windows when maximized, where the window
border is hidden off the screen. This margin may be used to ensure
user content doesn't overlap this space.

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

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

### window_decorations

```rust
fn window_decorations(self: &Self) -> WindowDecorations
```

The window decorations (title bar, border, etc).

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

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

### set_window_decorations

```rust
fn set_window_decorations(self: &Self, value: WindowDecorations)
```



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

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

### window_decorations_theme

```rust
fn window_decorations_theme(self: &Self) -> Option<Ref<ControlTheme>>
```

The theme used to render the window decorations when they are not
drawn by the system.

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

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

### set_window_decorations_theme

```rust
fn set_window_decorations_theme(self: &Self, value: impl Into<Nullable<ControlTheme>>)
```



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

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

### system_decorations

```rust
fn system_decorations(self: &Self) -> WindowDecorations
```



> **Deprecated.** Use window_decorations instead.

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

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

### set_system_decorations

```rust
fn set_system_decorations(self: &Self, value: WindowDecorations)
```



> **Deprecated.** Use set_window_decorations instead.

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

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

### show_activated

```rust
fn show_activated(self: &Self) -> bool
```

Whether a window is activated when first shown.

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

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

### set_show_activated

```rust
fn set_show_activated(self: &Self, value: bool)
```



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

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

### show_in_taskbar

```rust
fn show_in_taskbar(self: &Self) -> bool
```

Enables or disables the taskbar icon.

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

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

### set_show_in_taskbar

```rust
fn set_show_in_taskbar(self: &Self, value: bool)
```



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

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

### closing_behavior

```rust
fn closing_behavior(self: &Self) -> WindowClosingBehavior
```

A value indicating how the closing event behaves in the presence of
child windows.

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

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

### set_closing_behavior

```rust
fn set_closing_behavior(self: &Self, value: WindowClosingBehavior)
```



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

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

### window_state

```rust
fn window_state(self: &Self) -> WindowState
```

Represents the currently effective window state (normal, minimized,
maximized).

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

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

### set_window_state

```rust
fn set_window_state(self: &Self, value: WindowState)
```



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

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

### can_resize

```rust
fn can_resize(self: &Self) -> bool
```

Enables or disables resizing of the window.

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

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

### set_can_resize

```rust
fn set_can_resize(self: &Self, value: bool)
```



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

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

### can_minimize

```rust
fn can_minimize(self: &Self) -> bool
```

Enables or disables minimizing the window.

This property might be ignored by some window managers on Linux.

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

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

### set_can_minimize

```rust
fn set_can_minimize(self: &Self, value: bool)
```



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

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

### can_maximize

```rust
fn can_maximize(self: &Self) -> bool
```

Enables or disables maximizing the window.

When `CanResize` is false, this property is always false. On macOS,
setting this property to false also disables the full screen mode.
This property might be ignored by some window managers on Linux.

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

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

### set_can_maximize

```rust
fn set_can_maximize(self: &Self, value: bool)
```



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

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

### icon

```rust
fn icon(self: &Self) -> Option<Rc<WindowIcon>>
```

The icon of the window.

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

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

### set_icon

```rust
fn set_icon(self: &Self, value: Option<Rc<WindowIcon>>)
```



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

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

### window_startup_location

```rust
fn window_startup_location(self: &Self) -> WindowStartupLocation
```

The startup location of the window.

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

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

### set_window_startup_location

```rust
fn set_window_startup_location(self: &Self, value: WindowStartupLocation)
```



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

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

### position

```rust
fn position(self: &Self) -> PixelPoint
```

The window position in screen coordinates.

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

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

### set_position

```rust
fn set_position(self: &Self, value: PixelPoint)
```



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

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

### is_dialog

```rust
fn is_dialog(self: &Self) -> bool
```

Whether this window was opened as a dialog.

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

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

### begin_move_drag

```rust
fn begin_move_drag(self: &Self, e: &PointerPressedEventArgs)
```

Starts moving a window with left button being held. Should be called
from a left mouse button press event handler.

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

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

### begin_resize_drag

```rust
fn begin_resize_drag(self: &Self, edge: WindowEdge, e: &PointerPressedEventArgs)
```

Starts resizing a window. This function is used if an application
has window resizing controls. Should be called from a left mouse
button press event handler.

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

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

### closing

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

Fired before a window is closed.

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

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

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

### close

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

Closes the window.

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

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

### close_with_result

```rust
fn close_with_result(self: &Self, dialog_result: Option<BoxedValue>)
```

Closes a dialog window with the specified result.

When the window is shown with `show_dialog` or
`show_dialog_typed`, the handle of its task
gives the `dialog_result` value when the window is closed.

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

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

### close_core

```rust
fn close_core(self: &Self, reason: WindowCloseReason, is_programmatic: bool, ignore_cancel: bool)
```

Closes the window for `reason`; with `ignore_cancel` the window
closes even when a closing handler cancels (internal upstream: for
the application lifetime).

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

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

### show_with_owner

```rust
fn show_with_owner(self: &Self, owner: &Window)
```

Shows the window as a child of `owner`.
## Panics
Panics when the window has already been closed, and when the owner
is closed, not visible or the window itself.

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

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

### show_dialog

```rust
fn show_dialog(self: &Self, owner: &Window) -> JoinHandle<Option<BoxedValue>>
```

Shows the window as a dialog owned by `owner`.

Returns the handle of a task of the dispatcher that tracks the
lifetime of the dialog: it ends, in a dispatcher job, with the dialog
result (see `close_with_result`) once the
dialog has closed, or with `JoinError::Canceled` when the dispatcher
shuts down first. Nothing blocks: the caller keeps running, and
dropping the handle leaves the dialog open.
## Panics
Panics when the window has already been closed or is already shown,
and when the owner is closed, not visible or the window itself.

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

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

### show_dialog_typed

```rust
fn show_dialog_typed<TResult: Clone + Default + 'static>(self: &Self, owner: &Window) -> JoinHandle<TResult>
```

Shows the window as a dialog owned by `owner`; `TResult` is the type
of the result produced by the dialog.

Returns the handle of a task that gives the result of the dialog when
it closes: the value passed to
`close_with_result`, or the default of
`TResult` when the dialog closed without a result. When the dialog
result is not a `TResult`, the task panics, and its handle ends with
`JoinError::Panicked`.
## Panics
See `show_dialog`.

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

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

### show_dialog_task

```rust
fn show_dialog_task(self: &Self, owner: &Window) -> DispatcherTask<Option<BoxedValue>>
```

The deprecated form of `show_dialog`: a
`DispatcherTask`, which raises a failure again when it is observed.
## Panics
See `show_dialog`.

> **Deprecated since 0.5.0.** use `show_dialog`, which gives a `JoinHandle`

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

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

### show_dialog_typed_task

```rust
fn show_dialog_typed_task<TResult: Clone + Default + 'static>(self: &Self, owner: &Window) -> DispatcherTask<TResult>
```

The deprecated form of `show_dialog_typed`:
a `DispatcherTask`, which raises the failure to cast the dialog result
again when it is observed.
## Panics
See `show_dialog`.

> **Deprecated since 0.5.0.** use `show_dialog_typed`, which gives a `JoinHandle`

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

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

### sort_windows_by_z_order

```rust
fn sort_windows_by_z_order(windows: &mut [Ref<Window>])
```

Sorts the windows ascending by their Z order - the topmost window
will be the last in the list.
## Panics
Panics when one of the windows is closed, and when no windowing
platform is registered.

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

## 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/)
- [`WindowBaseImplExt`](/docs/0.5.0/api/ferroui-controls/trait-windowbaseimplext/)
- [`WindowImplExt`](/docs/0.5.0/api/ferroui-controls/trait-windowimplext/)
- `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<Window>`](/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/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`ContentControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-contentcontrolimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`IFocusScope`](/docs/0.5.0/api/ferroui-base/input/trait-ifocusscope/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`TopLevelImpl`](/docs/0.5.0/api/ferroui-controls/trait-toplevelimpl/)
- [`WindowBaseImpl`](/docs/0.5.0/api/ferroui-controls/trait-windowbaseimpl/)
- [`WindowImpl`](/docs/0.5.0/api/ferroui-controls/trait-windowimpl/)

## Availability

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