From 10f951c75485d19d9886c697bb6f06aa507d7723 Mon Sep 17 00:00:00 2001 From: Umut Comlekcioglu Date: Tue, 9 Oct 2018 22:08:22 +0300 Subject: [PATCH 1/2] OnMessageDismissed event trigger unexpectedly when I set the AnimationOut property with Delay. For solve this problem, I updated the 'DismissBefore' method with add listener to Animation.Completed event. With this update, OnMessageDimissed event trigger when AnimationOut fully completed --- .../NotificationMessageBuilderLinq.cs | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilderLinq.cs b/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilderLinq.cs index fca89be..a34fc58 100644 --- a/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilderLinq.cs +++ b/Enterwell.Clients.Wpf.Notifications/NotificationMessageBuilderLinq.cs @@ -231,7 +231,28 @@ private static Action DismissBefore( { return call => { - builder.Manager.Dismiss(builder.Message); + if (builder.Message is INotificationAnimation animatableMessage) + { + var animation = animatableMessage.AnimationOut; + if (animation != null && + animatableMessage.Animates && + animatableMessage.AnimatableElement != null && + animatableMessage.AnimationOutDependencyProperty != null) + { + animation.Completed += (s, a) => + { + builder.Manager.Dismiss(builder.Message); + }; + } + else + { + builder.Manager.Dismiss(builder.Message); + } + } + else + { + builder.Manager.Dismiss(builder.Message); + } callback?.Invoke(builder.Message); }; } @@ -251,7 +272,28 @@ private static Action DismissBefore( { return button => { - builder.Manager.Dismiss(builder.Message); + if (builder.Message is INotificationAnimation animatableMessage) + { + var animation = animatableMessage.AnimationOut; + if (animation != null && + animatableMessage.Animates && + animatableMessage.AnimatableElement != null && + animatableMessage.AnimationOutDependencyProperty != null) + { + animation.Completed += (s, a) => + { + builder.Manager.Dismiss(builder.Message); + }; + } + else + { + builder.Manager.Dismiss(builder.Message); + } + } + else + { + builder.Manager.Dismiss(builder.Message); + } callback?.Invoke(button); }; } From 402dab6f691232e047ab461cb5714b931957d02f Mon Sep 17 00:00:00 2001 From: Aleksandar Toplek Date: Thu, 11 Oct 2018 23:01:03 +0200 Subject: [PATCH 2/2] Updated changelog and bumped version --- Changelog.md | 4 ++++ .../Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index c43b70e..8d22869 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,10 @@ 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.1] - 2018-10-11 +### Fixed +- Fixed problem where message with animation would trigger dismiss event before disapearing + ## [1.4.0] - 2018-06-09 ### Added - Added `WithAdditionalContent` feature diff --git a/Enterwell.Clients.Wpf.Notifications/Properties/AssemblyInfo.cs b/Enterwell.Clients.Wpf.Notifications/Properties/AssemblyInfo.cs index b1da2fd..264a437 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.4.0.0")] -[assembly: AssemblyFileVersion("1.4.0.0")] +[assembly: AssemblyVersion("1.4.1.0")] +[assembly: AssemblyFileVersion("1.4.1.0")]