# InfoBar

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

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

```rust
struct InfoBar
```

An inline message of the application (WinUI's `InfoBar`): a title, a message, an action button
and content, with the icon and the colours of its `severity`, shown while
`is_open` and closed by its close button or by the application.

The control sets the states of WinUI as pseudo-classes, which the control theme of the WinUI
theme (`src/FerroUI.Themes.WinUI/Controls/InfoBar.xaml`) styles: `:informational`,
`:success`, `:warning`, `:error` (SeverityLevels), `:standard-icon-visible`,
`:user-icon-visible` (IconStates; neither is NoIconVisible), `:close-button-collapsed`,
`:open` (InfoBarVisible; its absence is InfoBarCollapsed), `:foreground-set` (a `Foreground`
set on the bar itself) and `:no-banner-content` (no title, message or action button). The
template parts it looks up are the button `CloseButton` and the severity icon `StandardIcon`;
the content is presented by `PART_ContentPresenter` (WinUI's `ContentArea`). The Fluent and
Simple themes have no template for it (docs/porting/winui-controls.md, section 5.1).

Differences from WinUI (docs/porting/winui-controls.md, section 10.2): the bar is a
[`ContentControl`](/docs/0.5.0/api/ferroui-controls/struct-contentcontrol/); UI Automation notifications are not raised (the peer reports the title and
the message as the name and a live setting of the severity instead); the texts of the close
button and the severity icons are WinUI's English texts.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`is_open_property`](#function-is_open_property)
- [`title_property`](#function-title_property)
- [`message_property`](#function-message_property)
- [`severity_property`](#function-severity_property)
- [`icon_source_property`](#function-icon_source_property)
- [`is_icon_visible_property`](#function-is_icon_visible_property)
- [`is_closable_property`](#function-is_closable_property)
- [`close_button_style_property`](#function-close_button_style_property)
- [`close_button_command_property`](#function-close_button_command_property)
- [`close_button_command_parameter_property`](#function-close_button_command_parameter_property)
- [`action_button_property`](#function-action_button_property)
- [`template_settings_property`](#function-template_settings_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`is_open`](#function-is_open)
- [`set_is_open`](#function-set_is_open)
- [`title`](#function-title)
- [`set_title`](#function-set_title)
- [`message`](#function-message)
- [`set_message`](#function-set_message)
- [`severity`](#function-severity)
- [`set_severity`](#function-set_severity)
- [`icon_source`](#function-icon_source)
- [`set_icon_source`](#function-set_icon_source)
- [`is_icon_visible`](#function-is_icon_visible)
- [`set_is_icon_visible`](#function-set_is_icon_visible)
- [`is_closable`](#function-is_closable)
- [`set_is_closable`](#function-set_is_closable)
- [`close_button_style`](#function-close_button_style)
- [`set_close_button_style`](#function-set_close_button_style)
- [`close_button_command`](#function-close_button_command)
- [`set_close_button_command`](#function-set_close_button_command)
- [`close_button_command_parameter`](#function-close_button_command_parameter)
- [`set_close_button_command_parameter`](#function-set_close_button_command_parameter)
- [`action_button`](#function-action_button)
- [`set_action_button`](#function-set_action_button)
- [`template_settings`](#function-template_settings)
- [`close_button_click`](#function-close_button_click)
- [`closing`](#function-closing)
- [`closed`](#function-closed)
- [`opened`](#function-opened)

<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/info_bar.rs#L176)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### is_open_property

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

Defines the `IsOpen` property: whether the bar is shown. `false` by default.

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

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

### title_property

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

Defines the `Title` property: the title of the message.

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

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

### message_property

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

Defines the `Message` property: the text of the message.

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

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

### severity_property

```rust
fn severity_property() -> &'static StyledProperty<InfoBarSeverity>
```

Defines the `Severity` property: the kind of the message, which selects its icon and
colours. `Informational` by default.

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

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

### icon_source_property

```rust
fn icon_source_property() -> &'static StyledProperty<Option<Ref<IconSource>>>
```

Defines the `IconSource` property: an icon of the application shown in place of the
icon of the severity.

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

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

### is_icon_visible_property

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

Defines the `IsIconVisible` property: whether an icon is shown. `true` by default.

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

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

### is_closable_property

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

Defines the `IsClosable` property: whether the close button is shown. `true` by
default.

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

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

### close_button_style_property

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

Defines the `CloseButtonStyle` property: the control theme of the close button
(WinUI's style; the WinUI theme sets `InfoBarCloseButtonStyle`).

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

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

### close_button_command_property

```rust
fn close_button_command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
```

Defines the `CloseButtonCommand` property: the command of the close button.

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

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

### close_button_command_parameter_property

```rust
fn close_button_command_parameter_property() -> &'static StyledProperty<Option<BoxedValue>>
```

Defines the `CloseButtonCommandParameter` property: the parameter of the command of the
close button.

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

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

### action_button_property

```rust
fn action_button_property() -> &'static StyledProperty<Option<Ref<Button>>>
```

Defines the `ActionButton` property: a button shown after the message.

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

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

### template_settings_property

```rust
fn template_settings_property() -> &'static DirectProperty<InfoBar, Ref<InfoBarTemplateSettings>>
```

Defines the `TemplateSettings` property: the values the template binds to (read-only).

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

<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/info_bar.rs#L431)

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

### new

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

Creates an info bar.

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

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

### is_open

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

Gets whether the bar is shown.

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

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

### set_is_open

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

Sets whether the bar is shown.

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

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

### title

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

Gets the title.

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

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

### set_title

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

Sets the title.

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

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

### message

```rust
fn message(self: &Self) -> String
```

Gets the message.

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

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

### set_message

```rust
fn set_message(self: &Self, value: impl Into<String>)
```

Sets the message.

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

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

### severity

```rust
fn severity(self: &Self) -> InfoBarSeverity
```

Gets the severity.

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

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

### set_severity

```rust
fn set_severity(self: &Self, value: InfoBarSeverity)
```

Sets the severity.

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

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

### icon_source

```rust
fn icon_source(self: &Self) -> Option<Ref<IconSource>>
```

Gets the icon of the application.

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

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

### set_icon_source

```rust
fn set_icon_source(self: &Self, value: Option<Ref<IconSource>>)
```

Sets the icon of the application.

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

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

### is_icon_visible

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

Gets whether an icon is shown.

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

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

### set_is_icon_visible

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

Sets whether an icon is shown.

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

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

### is_closable

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

Gets whether the close button is shown.

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

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

### set_is_closable

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

Sets whether the close button is shown.

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

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

### close_button_style

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

Gets the control theme of the close button.

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

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

### set_close_button_style

```rust
fn set_close_button_style(self: &Self, value: Option<Ref<ControlTheme>>)
```

Sets the control theme of the close button.

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

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

### close_button_command

```rust
fn close_button_command(self: &Self) -> Option<Rc<dyn ICommand>>
```

Gets the command of the close button.

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

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

### set_close_button_command

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

Sets the command of the close button.

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

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

### close_button_command_parameter

```rust
fn close_button_command_parameter(self: &Self) -> Option<BoxedValue>
```

Gets the parameter of the command of the close button.

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

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

### set_close_button_command_parameter

```rust
fn set_close_button_command_parameter(self: &Self, value: Option<BoxedValue>)
```

Sets the parameter of the command of the close button.

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

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

### action_button

```rust
fn action_button(self: &Self) -> Option<Ref<Button>>
```

Gets the action button.

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

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

### set_action_button

```rust
fn set_action_button(self: &Self, value: Option<Ref<Button>>)
```

Sets the action button.

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

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

### template_settings

```rust
fn template_settings(self: &Self) -> Ref<InfoBarTemplateSettings>
```

Gets the values the template binds to; each bar has its own.

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

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

### close_button_click

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

Adds a handler of `CloseButtonClick`, raised when the close button is clicked, before the
bar closes. Dropping the returned guard removes the handler; `Subscription::detach` keeps
it for the life of the bar.

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

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

### closing

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

Adds a handler of `Closing`, raised when the bar is about to close; a handler may cancel it.
Dropping the returned guard removes the handler; `Subscription::detach` keeps it for the
life of the bar.

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

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

### closed

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

Adds a handler of `Closed`, raised when the bar has closed. Dropping the returned guard
removes the handler; `Subscription::detach` keeps it for the life of the bar.

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

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

### opened

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

Adds a handler of `Opened`, raised when the bar opens. Dropping the returned guard removes
the handler; `Subscription::detach` keeps it for the life of the bar.

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

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

## Availability

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