private void OnDockingFloatspaceDisposed(object sender, EventArgs e) { // Cast to correct type and unhook event handlers so garbage collection can occur KryptonDockingFloatspace floatspaceElement = (KryptonDockingFloatspace)sender; floatspaceElement.Disposed -= new EventHandler(OnDockingFloatspaceDisposed); // Kill the floatspace window if (!FloatingWindow.IsDisposed) { FloatingWindow.Dispose(); } }