# WindowBase

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

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

```rust
struct WindowBase
```

Base class for top-level windows.

This class acts as a base for top level windows such as `Window` and
`PopupRoot`. It handles scheduling layout, styling and rendering as well
as tracking the window client size and window activation.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`hide`](#function-hide)
- [`show`](#function-show)
- [`on_resized`](#function-on_resized)
- [`arrange_set_bounds`](#function-arrange_set_bounds)
- [`is_visible_changed`](#function-is_visible_changed)
- [`is_active_property`](#function-is_active_property)
- [`owner_property`](#function-owner_property)
- [`topmost_property`](#function-topmost_property)
- [`ignore_visibility_changes`](#function-ignore_visibility_changes)
- [`freeze_visibility_change_handling`](#function-freeze_visibility_change_handling)
- [`activated`](#function-activated)
- [`deactivated`](#function-deactivated)
- [`position_changed`](#function-position_changed)
- [`resized`](#function-resized)
- [`is_active`](#function-is_active)
- [`screens`](#function-screens)
- [`owner`](#function-owner)
- [`set_owner`](#function-set_owner)
- [`topmost`](#function-topmost)
- [`set_topmost`](#function-set_topmost)
- [`desktop_scaling`](#function-desktop_scaling)
- [`desktop_scaling_override`](#function-desktop_scaling_override)
- [`set_desktop_scaling_override`](#function-set_desktop_scaling_override)
- [`activate`](#function-activate)
- [`ensure_initialized`](#function-ensure_initialized)

<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_base.rs#L44)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### hide

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

Hides the window.

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

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

### show

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

Shows the window.

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

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

### on_resized

```rust
fn on_resized(self: &Self, e: &WindowResizedEventArgs)
```

Raises the `Resized` event.

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

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

### arrange_set_bounds

```rust
fn arrange_set_bounds(self: &Self, size: Size) -> Size
```

Called during the arrange pass to set the size of the window;
returns the size to arrange the content with.

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

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

### is_visible_changed

```rust
fn is_visible_changed(self: &Self, e: &FerroPropertyChangedEventArgs<'_>)
```

Called when the `IsVisible` property changes.

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

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

### is_active_property

```rust
fn is_active_property() -> &'static DirectProperty<WindowBase, bool>
```

Defines the `IsActive` property.

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

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

### owner_property

```rust
fn owner_property() -> &'static DirectProperty<WindowBase, Option<Ref<WindowBase>>>
```

Defines the `Owner` property.

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

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

### topmost_property

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

Defines the `Topmost` property.

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

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

### ignore_visibility_changes

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

Whether visibility changes are currently ignored (protected
upstream).

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

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

### freeze_visibility_change_handling

```rust
fn freeze_visibility_change_handling(self: &Self) -> IgnoreVisibilityChangesGuard
```

Ignores visibility changes until the returned guard is dropped
(private protected upstream: for derived classes).

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

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

### activated

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

Fired when the window is activated.

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_base.rs#L361)

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

### deactivated

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

Fired when the window is deactivated.

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_base.rs#L369)

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

### position_changed

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

Fired when the window position is changed.

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_base.rs#L377)

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

### resized

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

Fired when the window is resized.

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_base.rs#L385)

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

### is_active

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

Whether the window is active.

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

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

### screens

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

The screens of the platform.
## Panics
Panics when the windowing backend does not provide screens.

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

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

### owner

```rust
fn owner(self: &Self) -> Option<Ref<WindowBase>>
```

The owner of the window.

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

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

### set_owner

```rust
fn set_owner(self: &Self, value: Option<Ref<WindowBase>>)
```

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

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

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

### topmost

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

Whether this window appears on top of all other windows.

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

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

### set_topmost

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



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

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

### desktop_scaling

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

The scaling factor for window positioning and sizing.

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

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

### desktop_scaling_override

```rust
fn desktop_scaling_override(self: &Self) -> Option<f64>
```

The desktop scaling used instead of the platform's (private
protected upstream: for derived classes).

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

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

### set_desktop_scaling_override

```rust
fn set_desktop_scaling_override(self: &Self, value: Option<f64>)
```



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

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

### activate

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

Activates the window.

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

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

### ensure_initialized

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

Ensures that the window is initialized (protected upstream: for
derived classes).

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

## 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/)
- `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<WindowBase>`](/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/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`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/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`ContentControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-contentcontrolimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`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/)

## Availability

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