# WindowNotificationManager

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

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

```rust
struct WindowNotificationManager
```

An [`INotificationManager`](/docs/0.5.0/api/ferroui-controls/notifications/trait-inotificationmanager/) that displays notifications in a window.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`position_property`](#function-position_property)
- [`max_items_property`](#function-max_items_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_host`](#function-with_host)
- [`position`](#function-position)
- [`set_position`](#function-set_position)
- [`max_items`](#function-max_items)
- [`set_max_items`](#function-set_max_items)
- [`show`](#function-show)
- [`show_content`](#function-show_content)
- [`show_with`](#function-show_with)
- [`close`](#function-close)
- [`close_content`](#function-close_content)
- [`close_all`](#function-close_all)
- [`as_managed_notification_manager`](#function-as_managed_notification_manager)
- [`as_notification_manager`](#function-as_notification_manager)

<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/notifications/window_notification_manager.rs#L41)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L41)

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

### position_property

```rust
fn position_property() -> &'static StyledProperty<NotificationPosition>
```

Defines the `Position` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L100)

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

### max_items_property

```rust
fn max_items_property() -> &'static StyledProperty<i32>
```

Defines the `MaxItems` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L100)

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

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L123)

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

### new

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

Creates a notification manager that is not hosted yet.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L132)

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

### with_host

```rust
fn with_host(host: Option<&Ref<TopLevel>>) -> Ref<Self>
```

Creates a notification manager hosted by `host`: the top-level that
will host the control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L138)

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

### position

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

Defines which corner of the screen notifications can be displayed in.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L157)

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

### set_position

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L161)

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

### max_items

```rust
fn max_items(self: &Self) -> i32
```

Defines the maximum number of notifications visible at once.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L166)

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

### set_max_items

```rust
fn set_max_items(self: &Self, value: i32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L170)

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

### show

```rust
fn show(self: &Self, content: Rc<dyn INotification>)
```

Shows a notification.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L175)

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

### show_content

```rust
fn show_content(self: &Self, content: BoxedValue)
```

Shows a notification with the given content: a notification, or any
other content, which is shown as information.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L183)

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

### show_with

```rust
fn show_with(self: &Self, content: BoxedValue, type_: NotificationType, expiration: Option<Duration>, on_click: Option<Rc<dyn Fn() -> ()>>, on_close: Option<Rc<dyn Fn() -> ()>>, classes: Option<&[&str]>)
```

Shows a notification.

* `content`: the content of the notification.
* `type_`: the type of the notification.
* `expiration`: the expiration time of the notification after which
  it will automatically close (five seconds when `None`). If the
  value is zero then the notification will remain open until the user
  closes it.
* `on_click`: an action to be run when the notification is clicked.
* `on_close`: an action to be run when the notification is closed.
* `classes`: style classes to apply.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L209)

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

### close

```rust
fn close(self: &Self, notification: &Rc<dyn INotification>)
```

Closes a notification.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L281)

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

### close_content

```rust
fn close_content(self: &Self, content: &BoxedValue)
```

Closes the notifications with the given content.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L286)

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

### close_all

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

Closes all notifications.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L308)

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

### as_managed_notification_manager

```rust
fn as_managed_notification_manager(self: &Self) -> Rc<dyn IManagedNotificationManager>
```

The manager as the contract of managed notification managers.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L317)

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

### as_notification_manager

```rust
fn as_notification_manager(self: &Self) -> Rc<dyn INotificationManager>
```

The manager as the contract of notification managers.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/notifications/window_notification_manager.rs#L322)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- `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<WindowNotificationManager>`](/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/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`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/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)

## Availability

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