InfoBar Class
Displays a bar with information of varying severity.
[TemplatePart(Name = "PART_ActionPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_CloseButton", Type = typeof(Button))]
[TemplatePart(Name = "PART_ContentPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_IconPresenter", 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 a new instance of the class.
public InfoBar()
Properties
Action
Gets or sets the content for the action.
ActionTemplate
Gets or sets the template used to display the Action.
ActionTemplateSelector
Gets or sets the DataTemplateSelector to use for the Action.
public DataTemplateSelector ActionTemplateSelector { get; set; }
Property Value
- DataTemplateSelector:
The DataTemplateSelector to use for the Action.
CanClose
Gets or sets if the control can be closed.
public bool CanClose { get; set; }
Property Value
- bool:
true
if the control can be closed; otherwisefalse
. The default value istrue
.
CloseButtonCommand
Gets or sets the command associated with the close button.
public ICommand? CloseButtonCommand { get; set; }
Property Value
See Also
CloseButtonCommandParameter
Gets or sets the parameter to be passed to the CloseButtonCommand.
public object? CloseButtonCommandParameter { get; set; }
Property Value
See Also
CloseButtonStyle
Gets or sets the Style applied to the close button.
CornerRadius
Gets or sets the CornerRadius applied to the control.
HasAction
Indicates whether Action has a non-null value.
HasMessage
Indicates whether Message has a non-null value.
HasTitle
Indicates whether Title has a non-null value.
HorizontalSpacing
Gets or sets the amount of horizontal spacing that appears between controls other than the icon and close button.
Icon
Gets or sets the content for the icon.
IconTemplate
Gets or sets the template used to display the Icon.
IconTemplateSelector
Gets or sets the DataTemplateSelector to use for the Icon.
public DataTemplateSelector IconTemplateSelector { get; set; }
Property Value
- DataTemplateSelector:
The DataTemplateSelector to use for the Icon.
IsAnimationEnabled
Gets or sets whether animations are enabled for an element, when supported.
public bool IsAnimationEnabled { get; set; }
Property Value
- bool:
true
if animations are enabled; otherwise,false
. The default value istrue
.
IsIconVisible
Gets or sets if the icon is visible.
public bool IsIconVisible { get; set; }
Property Value
- bool:
true
if the icon should be visible; otherwise,false
if the icon should not be visible. The default value istrue
.
IsOpen
Gets or sets if 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.
IsWrapped
Gets whether the layout is wrapped to multiple lines.
public bool IsWrapped { get; }
Property Value
- bool:
true
if the layout is wrapped to multiple lines; otherwise,false
if the layout (excluding content) is on a single line.
Message
Gets or sets the message.
Severity
Gets or sets the severity of the message.
public InfoBarSeverity Severity { get; set; }
Property Value
- InfoBarSeverity:
One of the InfoBarSeverity values. The default value is Information.
Title
Gets or sets the title.
VerticalSpacing
Gets or sets 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
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
Identifies the Action dependency property.
public static readonly DependencyProperty ActionProperty
ActionTemplateProperty
Identifies the ActionTemplate dependency property.
public static readonly DependencyProperty ActionTemplateProperty
ActionTemplateSelectorProperty
Identifies the ActionTemplateSelector dependency property.
public static readonly DependencyProperty ActionTemplateSelectorProperty
CanCloseProperty
Identifies the CanClose dependency property.
public static readonly DependencyProperty CanCloseProperty
CloseButtonCommandParameterProperty
Identifies the CloseButtonCommandParameter dependency property.
public static readonly DependencyProperty CloseButtonCommandParameterProperty
CloseButtonCommandProperty
Identifies the CloseButtonCommand dependency property.
public static readonly DependencyProperty CloseButtonCommandProperty
CloseButtonStyleProperty
Identifies the CloseButtonStyle dependency property.
public static readonly DependencyProperty CloseButtonStyleProperty
CornerRadiusProperty
Identifies the CornerRadius dependency property.
public static readonly DependencyProperty CornerRadiusProperty
HasActionProperty
Identifies the read-only HasAction dependency property.
public static readonly DependencyProperty HasActionProperty
HasMessageProperty
Identifies the read-only HasMessage dependency property.
public static readonly DependencyProperty HasMessageProperty
HasTitleProperty
Identifies the read-only HasTitle dependency property.
public static readonly DependencyProperty HasTitleProperty
HorizontalSpacingProperty
Identifies the HorizontalSpacing property.
public static readonly DependencyProperty HorizontalSpacingProperty
IconProperty
Identifies the Icon dependency property.
public static readonly DependencyProperty IconProperty
IconTemplateProperty
Identifies the IconTemplate dependency property.
public static readonly DependencyProperty IconTemplateProperty
IconTemplateSelectorProperty
Identifies the IconTemplateSelector dependency property.
public static readonly DependencyProperty IconTemplateSelectorProperty
IsAnimationEnabledProperty
Identifies the IsAnimationEnabled dependency property.
public static readonly DependencyProperty IsAnimationEnabledProperty
IsIconVisibleProperty
Identifies the IsIconVisible dependency property.
public static readonly DependencyProperty IsIconVisibleProperty
IsOpenProperty
Identifies the IsOpen dependency property.
public static readonly DependencyProperty IsOpenProperty
IsWrappedProperty
Identifies the read-only IsWrapped dependency property.
public static readonly DependencyProperty IsWrappedProperty
MessageProperty
Identifies the Message dependency property.
public static readonly DependencyProperty MessageProperty
SeverityProperty
Identifies the Severity dependency property.
public static readonly DependencyProperty SeverityProperty
TitleProperty
Identifies the Title dependency property.
public static readonly DependencyProperty TitleProperty
VerticalSpacingProperty
Identifies the VerticalSpacing property.
public static readonly DependencyProperty VerticalSpacingProperty