// ReSharper disable once CheckNamespace using WPFluent.Input; namespace WPFluent.Controls; /// /// An is an inline notification for essential app- wide messages. The InfoBar will take up space /// in a layout and will not cover up other content or float on top of it. It supports rich content (including titles, /// messages, and icons) and can be configured to be user-dismissable or persistent. /// public class InfoBar : System.Windows.Controls.ContentControl { /// /// Identifies the dependency property. /// public static readonly DependencyProperty IsClosableProperty = DependencyProperty.Register( nameof(IsClosable), typeof(bool), typeof(InfoBar), new PropertyMetadata(true)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register( nameof(IsOpen), typeof(bool), typeof(InfoBar), new PropertyMetadata(false)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty MessageProperty = DependencyProperty.Register( nameof(Message), typeof(string), typeof(InfoBar), new PropertyMetadata(string.Empty)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty SeverityProperty = DependencyProperty.Register( nameof(Severity), typeof(InfoBarSeverity), typeof(InfoBar), new PropertyMetadata(InfoBarSeverity.Attention)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty TemplateButtonCommandProperty = DependencyProperty.Register( nameof(TemplateButtonCommand), typeof(IRelayCommand), typeof(InfoBar), new PropertyMetadata(null)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty TitleProperty = DependencyProperty.Register( nameof(Title), typeof(string), typeof(InfoBar), new PropertyMetadata(string.Empty)); /// /// Initializes a new instance of the class. /// public InfoBar() { SetValue(TemplateButtonCommandProperty, new RelayCommand(_ => SetCurrentValue(IsOpenProperty, false))); } /// /// Gets or sets a value indicating whether the user can close the . Defaults to true. /// public bool IsClosable { get => (bool)GetValue(IsClosableProperty); set => SetValue(IsClosableProperty, value); } /// /// Gets or sets a value indicating whether the is open. /// public bool IsOpen { get => (bool)GetValue(IsOpenProperty); set => SetValue(IsOpenProperty, value); } /// /// Gets or sets the message of the . /// public string Message { get => (string)GetValue(MessageProperty); set => SetValue(MessageProperty, value); } /// /// Gets or sets the type of the to apply consistent status color, icon, and assistive /// technology settings dependent on the criticality of the notification. /// public InfoBarSeverity Severity { get => (InfoBarSeverity)GetValue(SeverityProperty); set => SetValue(SeverityProperty, value); } /// /// Gets the triggered after clicking the close button. /// internal IRelayCommand TemplateButtonCommand => (IRelayCommand)GetValue(TemplateButtonCommandProperty); /// /// Gets or sets the title of the . /// public string Title { get => (string)GetValue(TitleProperty); set => SetValue(TitleProperty, value); } }