FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    InfoBar

    struct · ferroui-controls · v0.5.0

    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; 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

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

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

    Returns a strong reference to this object.

    Source

    is_open_property

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

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

    Source

    title_property

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

    Defines the Title property: the title of the message.

    Source

    message_property

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

    Defines the Message property: the text of the message.

    Source

    severity_property

    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

    icon_source_property

    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

    is_icon_visible_property

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

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

    Source

    is_closable_property

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

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

    Source

    close_button_style_property

    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

    close_button_command_property

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

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

    Source

    close_button_command_parameter_property

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

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

    Source

    action_button_property

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

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

    Source

    template_settings_property

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

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

    Source

    construct

    fn construct() -> Self
    

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

    Source

    new

    fn new() -> Ref<Self>
    

    Creates an info bar.

    Source

    is_open

    fn is_open(self: &Self) -> bool
    

    Gets whether the bar is shown.

    Source

    set_is_open

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

    Sets whether the bar is shown.

    Source

    title

    fn title(self: &Self) -> String
    

    Gets the title.

    Source

    set_title

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

    Sets the title.

    Source

    message

    fn message(self: &Self) -> String
    

    Gets the message.

    Source

    set_message

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

    Sets the message.

    Source

    severity

    fn severity(self: &Self) -> InfoBarSeverity
    

    Gets the severity.

    Source

    set_severity

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

    Sets the severity.

    Source

    icon_source

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

    Gets the icon of the application.

    Source

    set_icon_source

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

    Sets the icon of the application.

    Source

    is_icon_visible

    fn is_icon_visible(self: &Self) -> bool
    

    Gets whether an icon is shown.

    Source

    set_is_icon_visible

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

    Sets whether an icon is shown.

    Source

    is_closable

    fn is_closable(self: &Self) -> bool
    

    Gets whether the close button is shown.

    Source

    set_is_closable

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

    Sets whether the close button is shown.

    Source

    close_button_style

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

    Gets the control theme of the close button.

    Source

    set_close_button_style

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

    Sets the control theme of the close button.

    Source

    close_button_command

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

    Gets the command of the close button.

    Source

    set_close_button_command

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

    Sets the command of the close button.

    Source

    close_button_command_parameter

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

    Gets the parameter of the command of the close button.

    Source

    set_close_button_command_parameter

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

    Sets the parameter of the command of the close button.

    Source

    action_button

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

    Gets the action button.

    Source

    set_action_button

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

    Sets the action button.

    Source

    template_settings

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

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

    Source

    close_button_click

    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

    closing

    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

    closed

    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

    opened

    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

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.