I'm not really sure how to do this, as I've never had a need for this pattern just yet. I'm looking for the correct pattern on creating an event handler in a separate class that can remove itself when the object that contains the event executes.
Basically, I want to create an EventHandler
that occurs on the WPF Window.Close
event. And, during the execution of the handler it removes itself from the Window.Close
event. I hope that's specific enough to go on.
Also, is there a specific name for this pattern?