ToastNotifications icon indicating copy to clipboard operation
ToastNotifications copied to clipboard

NullreferenceException when Custom notification does not have a "CloseButton"

Open kwaclaw opened this issue 6 years ago • 2 comments

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

kwaclaw avatar Mar 18 '19 22:03 kwaclaw

Hi. I have tried to add a Button named CloseButton. Exception is still there. Any workaround?

rollibolly avatar Apr 15 '19 11:04 rollibolly

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.

Reec-3 avatar Jul 13 '19 17:07 Reec-3