J
JS
I have an application with many user controls and forms which display
measurements in whatever the current unit system is. The current unit
system is kept in my 'Units' static class as Units.CurrentSystem. I
also have an event in the Units class called
Units.CurrentSystemChanged. My controls hook into this event (usually
in their OnLoad() method). However, I am not quite sure where to
unhook the event. I could do it in Dispose(), OnHandleDestroyed() or
somewhere else. I'd like to establish a pattern for doing this type
of thing in my application so if anyone has a comment I would
appreciate hearing it.
measurements in whatever the current unit system is. The current unit
system is kept in my 'Units' static class as Units.CurrentSystem. I
also have an event in the Units class called
Units.CurrentSystemChanged. My controls hook into this event (usually
in their OnLoad() method). However, I am not quite sure where to
unhook the event. I could do it in Dispose(), OnHandleDestroyed() or
somewhere else. I'd like to establish a pattern for doing this type
of thing in my application so if anyone has a comment I would
appreciate hearing it.