ToastNotifications
ToastNotifications copied to clipboard
NullreferenceException when Custom notification does not have a "CloseButton"
Library version
2.5.1
Expected behaviour
No exception
Actual behaviour
NullReferenceException
Steps to reproduce behaviour
Create custom notification that does not have a button named "CloseButton". NullereferenceException happens when mouse enters notification window. It happens in NotificationDisplayPart .OnMouseEnter, where btn.Visibility is set, since btn is null.
Code to reproduce behaviour
Questions
Hi. I have tried to add a Button named CloseButton. Exception is still there. Any workaround?
In your custom display part add Bind(_notification); to the constructor but you will also need the close button as this is referenced for some reason.