Skip to content

chadkuehn/AlertBarWpf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alert Bar WPF UserControl

This is a WPF usercontrol for displaying user updates through an alert bar. There are four types of alerts: success, danger, warning or information. The color scheme and icons for each are based on the type.

Screenshot 1

Dependencies

  • WPF Application

Usage

Download the archive or install the nuget. If you downloaded the archive then in Visual Studio you must go to Solution Explorer » right-click on References » Add a Reference » browse to DLL in the archive bin folder.

GUI:
In the xaml you must reference the namespace to add the usercontrol:

<Window ...
    xmlns:mbar="clr-namespace:AlertBarWpf;assembly=AlertBarWpf">

Using this reference place the control on the form. I typically position this above any other controls:

 <mbar:AlertBarWpf x:Name="msgbar" />

An optional IconVisibility parameter to remove icons from all alert messages. There is also a Theme parameter to adjust the look of the bar:

 <mbar:AlertBarWpf x:Name="msgbar" IconVisibility="False" Theme="Outline" />

Code Behind:
To make use of the control we trigger it in the xaml.cs. Call the methods like so:

msgbar.Clear();
msgbar.SetDangerAlert("Select an Item.");

Features

  • Multiple themes
  • Recognizable color scheme/icons for danger, success, warning, or information
  • Does not occupy space when not in use
  • Auto-closes (if desired)

API

Methods:

  • Clear
  • SetDangerAlert
  • SetSuccessAlert
  • SetWarningAlert
  • SetInformationAlert

Each of the creation methods above takes a message parameter and an optional timeout parameter (based on seconds).

XAML Properties:

  • Theme
  • IconVisibility

Themes:

  • Outline
  • Standard

Support

Found a bug or have a feature request? Open an issue.

Author

Chad Kuehn

Copyright & License

Copyright (c) 2014 Chad Kuehn

AlertBarWpf is available under the MIT license. See the LICENSE file for more information.