ClearMessages(string) does not work
NvrPhazed opened this issue · 5 comments
Hey I am new to this so apologies ahead of time if i missed something obvious or submitted wrongly. I was trying out the Custom Message and got everything to work except proper disposal of specific messages.
Library version
2.3.4.0
I am also using vb.net and not C#
Expected behaviour
Using ClearMessages(string) removes specific message(s) that contains string
Actual behaviour
When trying to clear a message on the notifier, using a string value never works only ClearMessages()
will but I need to remove specific messages.
Steps to reproduce behaviour
Not sure what to put here because It always happens for me. Just create a CustomMessage according to example. Couldn't use example program as a litmus since it doesn't get removed by a clearmessages() in program.
Code to reproduce behaviour
Attached in zip file (Visual Studio Project VS community 2017)
CustomToastNotification.zip
Questions
Why does NotificationItemsControl.removeNotification(CustomDisplayPart) not update the count of notifications on the Notifier Lifetime Supervisor? I tried using that which removed the notification but did not update the count so once the count hits the limit, it stops sending messages.
Hi thank you for reporting this error.
The thing is in current current implementation the whole message text is used to identify notification to remove. Another thing is TimeAndCountBasedLifetimeSupervisor has no implemented cleaning logic at all
I will change it to make it more flexible as soon as possible.
Thank you for the response. I look forward to seeing the results.
I still seem to still have the issue even when using the whole message text as the string value. It just seems to not work for some reason.
I managed to find a workaround by creating a CustomNotification variable in CustomDisplayPart.xaml.vb that holds the CustomNotification that is also bound to the CustomDisplayPart instance. Then I just call CustomNotification.Close() when the close button on the Message is pressed.
Fixed in 2.5.0 available via nugget.
Best regards.