diff --git a/Changelog.md b/Changelog.md index 5d7a991..c43b70e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.4.0] - 2018-06-09 +### Added +- Added `WithAdditionalContent` feature + +### Changed +- `NotificationHeaderTextStyle` and `NotificationMessageTextStyle` are now aligned left horizontally (instead of stretched) + +### Fixed +- `INotificationAnimation` interface is now marked as public + ## [1.3.1] - 2018-05-30 ### Fixed - Fixed message header foreground not set by `SetForeground` method call. diff --git a/Enterwell.Clients.Wpf.Notifications.Sample/App.xaml.cs b/Enterwell.Clients.Wpf.Notifications.Sample/App.xaml.cs index 4317718..2c5da0a 100644 --- a/Enterwell.Clients.Wpf.Notifications.Sample/App.xaml.cs +++ b/Enterwell.Clients.Wpf.Notifications.Sample/App.xaml.cs @@ -1,17 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -namespace Enterwell.Clients.Wpf.Notifications.Sample +namespace Enterwell.Clients.Wpf.Notifications.Sample { /// /// Interaction logic for App.xaml /// - public partial class App : Application + public partial class App { } } diff --git a/Enterwell.Clients.Wpf.Notifications.Sample/MainWindow.xaml b/Enterwell.Clients.Wpf.Notifications.Sample/MainWindow.xaml index 20b757f..ff265ba 100644 --- a/Enterwell.Clients.Wpf.Notifications.Sample/MainWindow.xaml +++ b/Enterwell.Clients.Wpf.Notifications.Sample/MainWindow.xaml @@ -1,10 +1,10 @@ - - + - + + + + @@ -38,7 +41,7 @@ - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Enterwell.Clients.Wpf.Notifications.Sample/MainWindow.xaml.cs b/Enterwell.Clients.Wpf.Notifications.Sample/MainWindow.xaml.cs index a77b7b0..c115374 100644 --- a/Enterwell.Clients.Wpf.Notifications.Sample/MainWindow.xaml.cs +++ b/Enterwell.Clients.Wpf.Notifications.Sample/MainWindow.xaml.cs @@ -1,10 +1,7 @@ using System; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; using System.Windows; using System.Windows.Controls; using System.Windows.Media; -using Enterwell.Clients.Wpf.Notifications.Controls; namespace Enterwell.Clients.Wpf.Notifications.Sample { @@ -92,16 +89,11 @@ private void ButtonBaseInfoDelayOnClick(object sender, RoutedEventArgs e) private void ButtonBaseAdditionalContentOnClick(object sender, RoutedEventArgs e) { - Thickness margin = new Thickness(); - margin.Top = margin.Bottom = margin.Left = margin.Right = 5; this.Manager .CreateMessage() .Accent("#1751C3") - .Animates(true) - .AnimationInDuration(0.5) - .AnimationOutDuration(0.5) .Background("#333") - .Foreground("#000") + .Foreground("#333") .HasBadge("Info") .HasHeader("Header") .HasMessage("This is the message!") @@ -140,23 +132,12 @@ private void ButtonBaseAdditionalContentOnClick(object sender, RoutedEventArgs e HorizontalAlignment = HorizontalAlignment.Stretch, Background = Brushes.Orange }) - .WithAdditionalContent(ContentLocation.OverBadge, new Border + .WithAdditionalContent(ContentLocation.AboveBadge, new Border { Height = 40, Width = 40, Background = Brushes.Indigo }) - .WithOverlay(new ProgressBar - { - VerticalAlignment = VerticalAlignment.Bottom, - HorizontalAlignment = HorizontalAlignment.Stretch, - Height = 3, - BorderThickness = new Thickness(0), - Foreground = new SolidColorBrush(Color.FromArgb(128, 255, 255, 255)), - Background = Brushes.Transparent, - IsIndeterminate = true, - IsHitTestVisible = false - }) .Dismiss().WithButton("Dismiss", button => { }) .Queue(); } diff --git a/Enterwell.Clients.Wpf.Notifications/ActionExtensions.cs b/Enterwell.Clients.Wpf.Notifications/ActionExtensions.cs deleted file mode 100644 index 51d89c3..0000000 --- a/Enterwell.Clients.Wpf.Notifications/ActionExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace Enterwell.Clients.Wpf.Notifications -{ - /// - /// The extensions. - /// - internal static class ActionExtensions - { - /// - /// Invokes the specified action after first action was successfully invoked. - /// - /// The action data type. - /// The action data type. - /// The base action. - /// The after base action. - /// Returns new action that first calls baseAction and then afterBaseAction. - public static Action DoAfter(this Action baseAction, Action afterBaseAction) - { - return (data1, data2) => - { - baseAction?.Invoke(data1, data2); - afterBaseAction?.Invoke(data1, data2); - }; - } - } -} \ No newline at end of file diff --git a/Enterwell.Clients.Wpf.Notifications/ContentLocation.cs b/Enterwell.Clients.Wpf.Notifications/ContentLocation.cs index 25e3097..7b27230 100644 --- a/Enterwell.Clients.Wpf.Notifications/ContentLocation.cs +++ b/Enterwell.Clients.Wpf.Notifications/ContentLocation.cs @@ -1,11 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Enterwell.Clients.Wpf.Notifications +namespace Enterwell.Clients.Wpf.Notifications { + /// + /// The additional content location. + /// public enum ContentLocation { Top, @@ -13,6 +10,6 @@ public enum ContentLocation Left, Right, Main, - OverBadge + AboveBadge } } diff --git a/Enterwell.Clients.Wpf.Notifications/Controls/NotificationMessage.cs b/Enterwell.Clients.Wpf.Notifications/Controls/NotificationMessage.cs index db8a1e2..7d3622b 100644 --- a/Enterwell.Clients.Wpf.Notifications/Controls/NotificationMessage.cs +++ b/Enterwell.Clients.Wpf.Notifications/Controls/NotificationMessage.cs @@ -257,10 +257,7 @@ public double AnimationOutDuration /// /// The animatable element used for show/hide animations. /// - public UIElement AnimatableElement - { - get => this; - } + public UIElement AnimatableElement => this; /// /// The animation in. @@ -327,7 +324,7 @@ public DependencyProperty AnimationInDependencyProperty get { var property = (DependencyProperty)GetValue(AnimationInDependencyPropProperty); - return property ?? UIElement.OpacityProperty; + return property ?? OpacityProperty; } set => SetValue(AnimationInDependencyPropProperty, value); } @@ -340,7 +337,7 @@ public DependencyProperty AnimationOutDependencyProperty get { var property = (DependencyProperty)GetValue(AnimationOutDependencyPropProperty); - return property ?? UIElement.OpacityProperty; + return property ?? OpacityProperty; } set => SetValue(AnimationOutDependencyPropProperty, value); } @@ -376,7 +373,7 @@ public DependencyProperty AnimationOutDependencyProperty DependencyProperty.Register("AdditionalContentRight", typeof(object), typeof(NotificationMessage), new PropertyMetadata(null)); /// - /// The additional content center property. + /// The additional content main property. /// public static readonly DependencyProperty AdditionalContentMainProperty = DependencyProperty.Register("AdditionalContentMain", typeof(object), typeof(NotificationMessage), new PropertyMetadata(null)); @@ -400,8 +397,7 @@ public DependencyProperty AnimationOutDependencyProperty /// The instance containing the event data. private static void AccentBrushPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) { - var @this = dependencyObject as NotificationMessage; - if (@this == null) + if (!(dependencyObject is NotificationMessage @this)) throw new NullReferenceException("Dependency object is not of valid type " + nameof(NotificationMessage)); if (@this.BadgeAccentBrush == null) @@ -446,8 +442,7 @@ private static void AccentBrushPropertyChangedCallback(DependencyObject dependen /// The instance containing the event data. private static void BadgeTextPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) { - var @this = dependencyObject as NotificationMessage; - if (@this == null) + if (!(dependencyObject is NotificationMessage @this)) throw new NullReferenceException("Dependency object is not of valid type " + nameof(NotificationMessage)); @this.BadgeVisibility = dependencyPropertyChangedEventArgs.NewValue == null @@ -474,8 +469,7 @@ private static void BadgeTextPropertyChangedCallback(DependencyObject dependency /// The instance containing the event data. private static void HeaderPropertyChangesCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) { - var @this = dependencyObject as NotificationMessage; - if (@this == null) + if (!(dependencyObject is NotificationMessage @this)) throw new NullReferenceException("Dependency object is not of valid type " + nameof(NotificationMessage)); @this.HeaderVisibility = dependencyPropertyChangedEventArgs.NewValue == null @@ -502,8 +496,7 @@ private static void HeaderPropertyChangesCallback(DependencyObject dependencyObj /// The instance containing the event data. private static void MessagePropertyChangesCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) { - var @this = dependencyObject as NotificationMessage; - if (@this == null) + if (!(dependencyObject is NotificationMessage @this)) throw new NullReferenceException("Dependency object is not of valid type " + nameof(NotificationMessage)); @this.MessageVisibility = dependencyPropertyChangedEventArgs.NewValue == null @@ -576,7 +569,7 @@ public NotificationMessage() { this.Buttons = new ObservableCollection(); - //Setting the default text color, if not defined by user. + // Setting the default text color, if not defined by user. this.Foreground = new BrushConverter().ConvertFromString("#DDDDDD") as Brush; } } diff --git a/Enterwell.Clients.Wpf.Notifications/Controls/NotificationMessageContainer.cs b/Enterwell.Clients.Wpf.Notifications/Controls/NotificationMessageContainer.cs index 9b97e2c..8fe5606 100644 --- a/Enterwell.Clients.Wpf.Notifications/Controls/NotificationMessageContainer.cs +++ b/Enterwell.Clients.Wpf.Notifications/Controls/NotificationMessageContainer.cs @@ -1,7 +1,6 @@ using System; using System.Windows; using System.Windows.Controls; -using System.Windows.Media.Animation; namespace Enterwell.Clients.Wpf.Notifications.Controls { @@ -19,8 +18,8 @@ public class NotificationMessageContainer : ItemsControl /// public INotificationMessageManager Manager { - get { return (INotificationMessageManager)GetValue(ManagerProperty); } - set { SetValue(ManagerProperty, value); } + get => (INotificationMessageManager)this.GetValue(ManagerProperty); + set => this.SetValue(ManagerProperty, value); } /// @@ -34,11 +33,10 @@ public INotificationMessageManager Manager /// /// The dependency object. /// The instance containing the event data. - /// Dependency object is not of valid type " + nameof(NotificationMessageContainer) + /// Dependency object is not of valid type - expected NotificationMessageContainer. private static void ManagerPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) { - var @this = dependencyObject as NotificationMessageContainer; - if (@this == null) + if (!(dependencyObject is NotificationMessageContainer @this)) throw new NullReferenceException("Dependency object is not of valid type " + nameof(NotificationMessageContainer)); if (dependencyPropertyChangedEventArgs.OldValue is INotificationMessageManager oldManager) @@ -80,12 +78,13 @@ private void ManagerOnOnMessageDismissed(object sender, NotificationMessageManag throw new InvalidOperationException( "Can't use both ItemsSource and Items collection at the same time."); - if (args.Message is INotificationAnimation) + if (args.Message is INotificationAnimation animatableMessage) { - var animatableMessage = args.Message as INotificationAnimation; var animation = animatableMessage.AnimationOut; - if (animatableMessage.Animates && animatableMessage.AnimatableElement != null - && animation != null && animatableMessage.AnimationOutDependencyProperty != null) + if (animation != null && + animatableMessage.Animates && + animatableMessage.AnimatableElement != null && + animatableMessage.AnimationOutDependencyProperty != null) { animation.Completed += (s, a) => this.RemoveMessage(args.Message); animatableMessage.AnimatableElement.BeginAnimation(animatableMessage.AnimationOutDependencyProperty, animation); @@ -103,7 +102,7 @@ private void ManagerOnOnMessageDismissed(object sender, NotificationMessageManag private void RemoveMessage(INotificationMessage message) { - this.Items?.Remove(message); + this.Items.Remove(message); } /// @@ -118,11 +117,10 @@ private void ManagerOnOnMessageQueued(object sender, NotificationMessageManagerE throw new InvalidOperationException( "Can't use both ItemsSource and Items collection at the same time."); - this.Items?.Add(args.Message); + this.Items.Add(args.Message); - if (args.Message is INotificationAnimation) + if (args.Message is INotificationAnimation animatableMessage) { - var animatableMessage = args.Message as INotificationAnimation; var animation = animatableMessage.AnimationIn; if (animatableMessage.Animates && animatableMessage.AnimatableElement != null && animation != null && animatableMessage.AnimationInDependencyProperty != null) diff --git a/Enterwell.Clients.Wpf.Notifications/Enterwell.Clients.Wpf.Notifications.csproj b/Enterwell.Clients.Wpf.Notifications/Enterwell.Clients.Wpf.Notifications.csproj index 8b6157c..130cdea 100644 --- a/Enterwell.Clients.Wpf.Notifications/Enterwell.Clients.Wpf.Notifications.csproj +++ b/Enterwell.Clients.Wpf.Notifications/Enterwell.Clients.Wpf.Notifications.csproj @@ -53,7 +53,6 @@ - diff --git a/Enterwell.Clients.Wpf.Notifications/INotificationAnimation.cs b/Enterwell.Clients.Wpf.Notifications/INotificationAnimation.cs index 2803df5..eadc83e 100644 --- a/Enterwell.Clients.Wpf.Notifications/INotificationAnimation.cs +++ b/Enterwell.Clients.Wpf.Notifications/INotificationAnimation.cs @@ -7,7 +7,7 @@ namespace Enterwell.Clients.Wpf.Notifications /// The animation properties for a notification message or some /// other item. /// - interface INotificationAnimation + public interface INotificationAnimation { /// /// Gets or sets whether the item animates in and out. diff --git a/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilder.cs b/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilder.cs index b13f1fe..b8a5f1d 100644 --- a/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilder.cs +++ b/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilder.cs @@ -31,7 +31,7 @@ public class NotificationMessageBuilder /// /// Creates the message. /// - /// Returns new instance of notification message builder tha tis used to create notification message. + /// Returns new instance of notification message builder that is used to create notification message. public static NotificationMessageBuilder CreateMessage() { return new NotificationMessageBuilder(); @@ -171,33 +171,33 @@ public void SetForeground(Brush brush) /// public void SetAnimates(bool animates) { - if (this.Message is INotificationAnimation) + if (this.Message is INotificationAnimation animation) { - ((INotificationAnimation)this.Message).Animates = animates; + animation.Animates = animates; } } /// /// Sets the duration for the animation in (in seconds). /// - /// + /// The in animation duration (in seconds). public void SetAnimationInDuration(double duration) { - if (this.Message is INotificationAnimation) + if (this.Message is INotificationAnimation animation) { - ((INotificationAnimation)this.Message).AnimationInDuration = duration; + animation.AnimationInDuration = duration; } } /// /// Sets the duration for the animation out (in seconds). /// - /// + /// The out animation duration (in seconds). public void SetAnimationOutDuration(double duration) { - if (this.Message is INotificationAnimation) + if (this.Message is INotificationAnimation animation) { - ((INotificationAnimation)this.Message).AnimationOutDuration = duration; + animation.AnimationOutDuration = duration; } } @@ -207,9 +207,9 @@ public void SetAnimationOutDuration(double duration) /// public void SetAnimationIn(AnimationTimeline animation) { - if (this.Message is INotificationAnimation) + if (this.Message is INotificationAnimation notificationAnimation) { - ((INotificationAnimation)this.Message).AnimationIn = animation; + notificationAnimation.AnimationIn = animation; } } @@ -219,9 +219,9 @@ public void SetAnimationIn(AnimationTimeline animation) /// public void SetAnimationOut(AnimationTimeline animation) { - if (this.Message is INotificationAnimation) + if (this.Message is INotificationAnimation notificationAnimation) { - ((INotificationAnimation)this.Message).AnimationOut = animation; + notificationAnimation.AnimationOut = animation; } } @@ -231,9 +231,9 @@ public void SetAnimationOut(AnimationTimeline animation) /// public void SetAnimationInDependencyProperty(DependencyProperty property) { - if (this.Message is INotificationAnimation) + if (this.Message is INotificationAnimation animation) { - ((INotificationAnimation)this.Message).AnimationInDependencyProperty = property; + animation.AnimationInDependencyProperty = property; } } @@ -243,9 +243,9 @@ public void SetAnimationInDependencyProperty(DependencyProperty property) /// public void SetAnimationOutDependencyProperty(DependencyProperty property) { - if (this.Message is INotificationAnimation) + if (this.Message is INotificationAnimation animation) { - ((INotificationAnimation)this.Message).AnimationOutDependencyProperty = property; + animation.AnimationOutDependencyProperty = property; } } diff --git a/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilderLinq.cs b/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilderLinq.cs index 53383f2..fca89be 100644 --- a/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilderLinq.cs +++ b/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilderLinq.cs @@ -2,6 +2,8 @@ using System.Windows; using System.Windows.Media; using System.Windows.Media.Animation; +// ReSharper disable UnusedMember.Global +// ReSharper disable RedundantEmptySwitchSection namespace Enterwell.Clients.Wpf.Notifications { @@ -11,11 +13,11 @@ namespace Enterwell.Clients.Wpf.Notifications public static class NotificationMessageBuilderLinq { /// - /// Sets the notification mesage background. + /// Sets the notification message background. /// /// The builder. /// The background brush. - /// Returns the noitificaiton message builder. + /// Returns the notification message builder. public static NotificationMessageBuilder Background( this NotificationMessageBuilder builder, Brush backgroundBrush) @@ -26,11 +28,11 @@ public static NotificationMessageBuilder Background( } /// - /// Sets the notification mesage background. + /// Sets the notification message background. /// /// The builder. /// The background brush. - /// Returns the noitificaiton message builder. + /// Returns the notification message builder. public static NotificationMessageBuilder Background( this NotificationMessageBuilder builder, string backgroundBrush) @@ -42,11 +44,11 @@ public static NotificationMessageBuilder Background( } /// - /// Sets the notification mesage accent. + /// Sets the notification message accent. /// /// The builder. /// The accent brush. - /// Returns the noitificaiton message builder. + /// Returns the notification message builder. public static NotificationMessageBuilder Accent( this NotificationMessageBuilder builder, Brush accentBrush) @@ -57,11 +59,11 @@ public static NotificationMessageBuilder Accent( } /// - /// Sets the notification mesage accent. + /// Sets the notification message accent. /// /// The builder. /// The accent brush. - /// Returns the noitificaiton message builder. + /// Returns the notification message builder. public static NotificationMessageBuilder Accent( this NotificationMessageBuilder builder, string accentBrush) @@ -134,10 +136,10 @@ public static NotificationMessageBuilder CreateMessage( /// /// Marks next button to be dismiss. - /// This button will dismiss the noitification message when clicked. + /// This button will dismiss the notification message when clicked. /// /// The builder. - /// Returns the notiification message builder. + /// Returns the notification message builder. public static NotificationMessageBuilder.DismissNotificationMessage Dismiss( this NotificationMessageBuilder builder) { @@ -240,7 +242,7 @@ private static Action DismissBefore( /// The builder. /// The callback. /// - /// Returns the action that will call manager dismiss for noitification + /// Returns the action that will call manager dismiss for notification /// message in builder when button is clicked and then call the callback action. /// private static Action DismissBefore( @@ -255,7 +257,7 @@ private static Action DismissBefore( } /// - /// Sets the noitification message overlay. + /// Sets the notification message overlay. /// /// The builder. /// The overlay. @@ -270,7 +272,7 @@ public static NotificationMessageBuilder WithOverlay( } /// - /// Sets the noitification message top additional content. + /// Sets the notification message top additional content. /// /// The builder. /// The additional content. @@ -308,7 +310,7 @@ public static NotificationMessageBuilder WithAdditionalContent( builder.SetAdditionalContentMain(additionalContent); break; } - case ContentLocation.OverBadge: + case ContentLocation.AboveBadge: { builder.SetAdditionalContentOverBadge(additionalContent); break; @@ -326,7 +328,7 @@ public static NotificationMessageBuilder WithAdditionalContent( /// /// The builder. /// The foreground brush. - /// Returns the noitificaiton message builder. + /// Returns the notification message builder. public static NotificationMessageBuilder Foreground( this NotificationMessageBuilder builder, string foregroundBrush) @@ -342,7 +344,7 @@ public static NotificationMessageBuilder Foreground( /// /// The builder. /// Whether or not the message should animate. - /// + /// Returns the notification message builder. public static NotificationMessageBuilder Animates( this NotificationMessageBuilder builder, bool animates) @@ -357,7 +359,7 @@ public static NotificationMessageBuilder Animates( /// /// The builder. /// How long the message should animate in (in seconds). - /// + /// Returns the notification message builder. public static NotificationMessageBuilder AnimationInDuration( this NotificationMessageBuilder builder, double duration) @@ -372,7 +374,7 @@ public static NotificationMessageBuilder AnimationInDuration( /// /// The builder. /// How long the message should animate out (in seconds). - /// + /// Returns the notification message builder. public static NotificationMessageBuilder AnimationOutDuration( this NotificationMessageBuilder builder, double duration) @@ -386,8 +388,8 @@ public static NotificationMessageBuilder AnimationOutDuration( /// Sets the animation in for the message. /// /// The builder. - /// The message animation in. - /// + /// The animation time line. + /// Returns the notification message builder. public static NotificationMessageBuilder AnimationIn( this NotificationMessageBuilder builder, AnimationTimeline animation) @@ -401,8 +403,8 @@ public static NotificationMessageBuilder AnimationIn( /// Sets the animation out for the message. /// /// The builder. - /// The message animation out. - /// + /// The animation time line. + /// Returns the notification message builder. public static NotificationMessageBuilder AnimationOut( this NotificationMessageBuilder builder, AnimationTimeline animation) @@ -416,8 +418,8 @@ public static NotificationMessageBuilder AnimationOut( /// Sets the animation in dependency property for the message. /// /// The builder. - /// The animation in dependency property. - /// + /// The animation in dependency property. + /// Returns the notification message builder. public static NotificationMessageBuilder AnimationInDependencyProperty( this NotificationMessageBuilder builder, DependencyProperty property) @@ -431,8 +433,8 @@ public static NotificationMessageBuilder AnimationInDependencyProperty( /// Sets the animation out dependency property for the message. /// /// The builder. - /// The animation out dependency property. - /// + /// The animation out dependency property. + /// Returns the notification message builder. public static NotificationMessageBuilder AnimationOutDependencyProperty( this NotificationMessageBuilder builder, DependencyProperty property) diff --git a/Enterwell.Clients.Wpf.Notifications/NotificationMessageFactory.cs b/Enterwell.Clients.Wpf.Notifications/NotificationMessageFactory.cs index 3281d92..9378288 100644 --- a/Enterwell.Clients.Wpf.Notifications/NotificationMessageFactory.cs +++ b/Enterwell.Clients.Wpf.Notifications/NotificationMessageFactory.cs @@ -3,7 +3,7 @@ namespace Enterwell.Clients.Wpf.Notifications { /// - /// The noitification message factory. + /// The notification message factory. /// /// public class NotificationMessageFactory : INotificationMessageFactory diff --git a/Enterwell.Clients.Wpf.Notifications/NotificationMessageManagerEventArgs.cs b/Enterwell.Clients.Wpf.Notifications/NotificationMessageManagerEventArgs.cs index 2a78063..13f7ab0 100644 --- a/Enterwell.Clients.Wpf.Notifications/NotificationMessageManagerEventArgs.cs +++ b/Enterwell.Clients.Wpf.Notifications/NotificationMessageManagerEventArgs.cs @@ -3,7 +3,7 @@ namespace Enterwell.Clients.Wpf.Notifications { /// - /// The notificaiton message manager event arguments. + /// The notification message manager event arguments. /// /// public class NotificationMessageManagerEventArgs : EventArgs diff --git a/Enterwell.Clients.Wpf.Notifications/Properties/AssemblyInfo.cs b/Enterwell.Clients.Wpf.Notifications/Properties/AssemblyInfo.cs index 8e89c65..b1da2fd 100644 --- a/Enterwell.Clients.Wpf.Notifications/Properties/AssemblyInfo.cs +++ b/Enterwell.Clients.Wpf.Notifications/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.1.0")] -[assembly: AssemblyFileVersion("1.3.1.0")] +[assembly: AssemblyVersion("1.4.0.0")] +[assembly: AssemblyFileVersion("1.4.0.0")] diff --git a/Enterwell.Clients.Wpf.Notifications/Themes/Generic.xaml b/Enterwell.Clients.Wpf.Notifications/Themes/Generic.xaml index c21b405..1663931 100644 --- a/Enterwell.Clients.Wpf.Notifications/Themes/Generic.xaml +++ b/Enterwell.Clients.Wpf.Notifications/Themes/Generic.xaml @@ -1,7 +1,8 @@ - + #333333 #666666 @@ -17,6 +18,13 @@ + + @@ -41,25 +51,28 @@ - - - + + + @@ -85,28 +98,29 @@ - - - + + + - @@ -120,105 +134,116 @@ - - - - - - - - - + + + + + + + + + - - + + - - + + - + - - + + - - + + - + @@ -232,14 +257,15 @@ - + @@ -260,18 +286,20 @@ - + - + diff --git a/Readme.md b/Readme.md index 0e1df72..a7d1465 100644 --- a/Readme.md +++ b/Readme.md @@ -116,6 +116,23 @@ manager.CreateMessage() The `WithOverlay` allows you to set custom overlay content. In this example a progress bar is placed on the bottom of notification control. Notice the `IsHitTextVisible` is set to `false` so that notification message buttons don't lose focus due to overlay control being over the bottom part of the buttons. +### Custom additional content for notification + +```c# +manager.CreateMessage() + .Accent("#F15B19") + .Background("#F15B19") + .HasHeader("Lost connection to server") + .HasMessage("Reconnecting...") + .WithAdditionalContent(ContentLocation.Main, new CheckBox + { + Margin = new Thickness(16), + HorizontalAlignment = HorizontalAlignment.Right, + Content = "Don't show again" + }) + .Queue(); +``` + ### Multiple notification The `NotificationMessageContainer` has build-in support for showing multiple notifications at the same time. New notifications will show at the bottom of the message stack.