# WindowCloseReason

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/enum-windowclosereason/

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

```rust
enum WindowCloseReason
```

Specifies the reason that a window was closed.

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

## Members

- [`Undefined`](#variant-undefined)
- [`WindowClosing`](#variant-windowclosing)
- [`OwnerWindowClosing`](#variant-ownerwindowclosing)
- [`ApplicationShutdown`](#variant-applicationshutdown)
- [`OSShutdown`](#variant-osshutdown)

<a id="variant-undefined"></a>

### Undefined

```rust
Undefined = 0
```

The cause of the closure was not provided by the underlying platform.

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

<a id="variant-windowclosing"></a>

### WindowClosing

```rust
WindowClosing = 1
```

The window itself was requested to close.

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

<a id="variant-ownerwindowclosing"></a>

### OwnerWindowClosing

```rust
OwnerWindowClosing = 2
```

The window is closing due to a parent/owner window closing.

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

<a id="variant-applicationshutdown"></a>

### ApplicationShutdown

```rust
ApplicationShutdown = 3
```

The window is closing due to the application shutting down.

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

<a id="variant-osshutdown"></a>

### OSShutdown

```rust
OSShutdown = 4
```

The window is closing due to the operating system shutting down.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)
- `Clone`
- `Copy`
- `Debug`
- `Default`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`

## Availability

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