1

I am using controls in my WPF window, and based on user interaction, I have to subscribe different controls ValueChanged/VisibilityChanged events. Is there any to check whether event is already subscribed or not, so that I should not subscribe it again.

Actually I am looking for a best practice for event subscription so that an object can only subscribe an event of other object once only.

  • 1
    http://stackoverflow.com/questions/2697247/how-to-determine-if-an-event-is-already-subscribed?rq=1 should be exactly what you are looking for. – Timo Küfner Mar 10 '16 at 11:18
  • Or you can do it without setting up a ton of boooleans http://stackoverflow.com/questions/136975/has-an-event-handler-already-been-added – BugFinder Mar 10 '16 at 11:26

1 Answers1

0

If event variable is null, then there's no subscription for Event.

Asad Mehmood
  • 514
  • 2
  • 12