Table of Contents

Class InfoBar

Namespace
Tudormobile.Wpf.Controls
Assembly
Tudormobile.WpfControls.dll

Displays an information bar to provide a message to the user.

Messages are marked with a severity type InfoBar.InfoSeverity and will display an icon corresponding to the severity. An optional title and message text is provided. The user can dismiss the bar if the IsClosable property is true, which is the default behavior. If IsClosable is false, the Closed event is not raised when the information bar is programatically removed.

public class InfoBar : Control, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient
Inheritance
InfoBar
Implements
Inherited Members

Remarks

You can apply a border, background, and padding to easily stylize the message. The background is used when the Informational severity is applied, otherwise it is 'tinted' green, yellow, or red according to the severity. The informational background is otherwise transparent.

You can attach a Command or handle the Closed event to be signaled when the user dismisses the bar.

Fields

ClosedEvent

Closed Routed Event.Raised when the user dismisses the information bar.

This event is not raised if the IsClosable property is set to (false).

public static readonly RoutedEvent ClosedEvent

Field Value

RoutedEvent

Properties

CloseCommand

Close Command. Invoked when the user closes the information bar.

public ICommand? CloseCommand { get; set; }

Property Value

ICommand

Remarks

Similar to the closed event, this command is not invoked is IsClosable is false.

IsClosable

True if the information bar is closable by the user, otherwise false.

public bool IsClosable { get; set; }

Property Value

bool

IsOpen

True if the information bar is currently displayed to the user (Open); otherwise False. Setting this value to false will close the information bar, however, the Closed event and command are not raised in this case. By default, the InformationBar is not open (IsOpen = false) and therefore not displayed.

public bool IsOpen { get; set; }

Property Value

bool

Message

Message for the information bar. The message is displayed following the title if there is room for both to fit on a single line, otherwise, it is displayed below the title.

public string? Message { get; set; }

Property Value

string

Severity

Severity level of the information. The information bar is stylized according to the severity level. The default value is 'Informational', which results in a minimally stylized bar including transparent background and no border (unless explicity set).

public InfoBar.InfoSeverity Severity { get; set; }

Property Value

InfoBar.InfoSeverity

Title

Title for the information. (Optional). The title is displayed in semi-bold text.

public string? Title { get; set; }

Property Value

string

Methods

OnClosed()

Raises the OnClosed event.

protected virtual void OnClosed()

Events

Closed

Closed Routed Event.Raised when the user dismisses the information bar.

This even is not raised if the IsClosable property is set to (false).

public event RoutedEventHandler Closed

Event Type

RoutedEventHandler