InfoBar Class
Displays a bar with information of varying severity.
[TemplatePart(Name = "PART_CloseButton", Type = typeof(Button))]
[TemplatePart(Name = "PART_ContentPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_IconPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_ActionPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_MessageElement", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "PART_TitleElement", Type = typeof(FrameworkElement))]
public class InfoBar : ContentControl
- Inheritance:
- object Visual UIElement FrameworkElement Control ContentControl object
Constructors
InfoBar()
Initializes an instance of the class.
public InfoBar()
Properties
Action
The content for the action.
ActionTemplate
The template used to display the Action.
ActionTemplateSelector
The DataTemplateSelector to use for the Action.
public DataTemplateSelector? ActionTemplateSelector { get; set; }
Property Value
CanClose
Indicates if the control can be closed.
CloseButtonCommand
The command associated with the close button.
public ICommand? CloseButtonCommand { get; set; }
Property Value
See Also
CloseButtonCommandParameter
The parameter to be passed to the CloseButtonCommand.
public object? CloseButtonCommandParameter { get; set; }
Property Value
See Also
CloseButtonStyle
The Style applied to the close button.
CornerRadius
The CornerRadius applied to the control.
HasAction
Indicates whether Action has a non-null value.
HasMessage
Indicates whether Message has a non-null, non-empty value.
HasTitle
Indicates whether Title has a non-null, non-empty value.
HorizontalSpacing
The amount of horizontal spacing that appears between controls other than the icon and close button.
Icon
The content for the icon.
IconTemplate
The template used to display the Icon.
IconTemplateSelector
The DataTemplateSelector to use for the Icon.
IsAnimationEnabled
Indicates whether animations are enabled for an element, when supported.
IsIconVisible
Indicates whether the icon is visible.
public bool IsIconVisible { get; set; }
Property Value
- bool:
trueif the icon should be visible; otherwise,falseif the icon should not be visible. The default value istrue.
IsOpen
Indicates whether the control is open.
public bool IsOpen { get; set; }
Property Value
- bool:
The default value is
true.
Remarks
Use this property instead of the Visibility property to control if the info bar is displayed.
IsSingleLineAllowed
Indicates if a single-line display is allowed or if controls should always be wrapped.
public bool IsSingleLineAllowed { get; set; }
Property Value
- bool:
trueto allow a single-line display when space is available; otherwise,falseto force a wrapped layout. The default value istrue.
IsWrapped
Indicates whether the layout is wrapped to multiple lines.
public bool IsWrapped { get; }
Property Value
- bool:
trueif the layout is wrapped to multiple lines; otherwise,falseif the layout (excluding content) is on a single line.
Message
The message.
Severity
The severity of the message.
public InfoBarSeverity Severity { get; set; }
Property Value
- InfoBarSeverity:
The default value is Information.
Title
The title.
VerticalSpacing
The amount of vertical spacing that appears between controls.
Methods
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer:
The type-specific AutomationPeer implementation.
ToString()
Returns the string representation of this object.
Events
CloseButtonClick
Occurs when the close button is clicked.
public event EventHandler<RoutedEventArgs>? CloseButtonClick
Event Type
Remarks
Set RoutedEventArgs.Handled to true to prevent default handling of the click event.
Closed
Occurs when the info bar is closed.
Closing
Occurs when the info bar is in the process of being closed.
public event EventHandler<InfoBarClosingEventArgs>? Closing
Event Type
Fields
ActionProperty
Defines the Action property.
public static readonly DependencyProperty ActionProperty
ActionTemplateProperty
Defines the ActionTemplate property.
public static readonly DependencyProperty ActionTemplateProperty
ActionTemplateSelectorProperty
Defines the ActionTemplateSelector property.
public static readonly DependencyProperty ActionTemplateSelectorProperty
CanCloseProperty
Defines the CanClose property.
public static readonly DependencyProperty CanCloseProperty
CloseButtonCommandParameterProperty
Defines the CloseButtonCommandParameter property.
public static readonly DependencyProperty CloseButtonCommandParameterProperty
CloseButtonCommandProperty
Defines the CloseButtonCommand property.
public static readonly DependencyProperty CloseButtonCommandProperty
CloseButtonStyleProperty
Defines the CloseButtonStyle property.
public static readonly DependencyProperty CloseButtonStyleProperty
CornerRadiusProperty
Defines the CornerRadius property.
public static readonly DependencyProperty CornerRadiusProperty
HasActionProperty
Defines the HasAction property.
public static readonly DependencyProperty HasActionProperty
HasMessageProperty
Defines the HasMessage property.
public static readonly DependencyProperty HasMessageProperty
HasTitleProperty
Defines the HasTitle property.
public static readonly DependencyProperty HasTitleProperty
HorizontalSpacingProperty
Defines the HorizontalSpacing property.
public static readonly DependencyProperty HorizontalSpacingProperty
IconProperty
Defines the Icon property.
public static readonly DependencyProperty IconProperty
IconTemplateProperty
Defines the IconTemplate property.
public static readonly DependencyProperty IconTemplateProperty
IconTemplateSelectorProperty
Defines the IconTemplateSelector property.
public static readonly DependencyProperty IconTemplateSelectorProperty
IsAnimationEnabledProperty
Defines the IsAnimationEnabled property.
public static readonly DependencyProperty IsAnimationEnabledProperty
IsIconVisibleProperty
Defines the IsIconVisible property.
public static readonly DependencyProperty IsIconVisibleProperty
IsOpenProperty
Defines the IsOpen property.
public static readonly DependencyProperty IsOpenProperty
IsSingleLineAllowedProperty
Defines the IsSingleLineAllowed property.
public static readonly DependencyProperty IsSingleLineAllowedProperty
IsWrappedProperty
Defines the IsWrapped property.
public static readonly DependencyProperty IsWrappedProperty
MessageProperty
Defines the Message property.
public static readonly DependencyProperty MessageProperty
SeverityProperty
Defines the Severity property.
public static readonly DependencyProperty SeverityProperty
TitleProperty
Defines the Title property.
public static readonly DependencyProperty TitleProperty
VerticalSpacingProperty
Defines the VerticalSpacing property.
public static readonly DependencyProperty VerticalSpacingProperty