ComponentFactory / Krypton

Krypton WinForms components for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PageCloseRequest event in kryptonDockingManager trigger only one time i need every time

rajesh-smartwebtech opened this issue · comments


            //Get the KryptonWorkspaceCell somehow, I only have one so only getting the first.
            KryptonWorkspaceCell workspaceCell = kryptonDockingManager.CellsWorkspace.FirstOrDefault();
            workspaceCell.CloseAction += WorkspaceCell_CloseAction;
            kryptonDockingManager.PageCloseRequest += KryptonDockingManager_PageCloseRequest;

        //clear page from memory if browser
        private void KryptonDockingManager_PageCloseRequest(object sender, CloseRequestEventArgs e)
        {
           
        }

KryptonDockingManager_PageCloseRequest function only one time work after add new it is not working

i have got it

            KryptonWorkspaceCell workspaceCell = kryptonDockingManager.CellsWorkspace.FirstOrDefault();
            workspaceCell.CloseAction += WorkspaceCell_CloseAction;
            kryptonDockingManager.PageCloseRequest += KryptonDockingManager_PageCloseRequest;
                        
            kryptonDockingManager.DockableWorkspaceCellAdding += KryptonDockingManager_DockableWorkspaceCellAdding;
            kryptonDockingManager.DockableWorkspaceCellRemoved += KryptonDockingManager_DockableWorkspaceCellRemoved;

            workspaceCell.BeforePageDrag += WorkspaceCell_BeforePageDrag;



        private void KryptonDockingManager_DockableWorkspaceCellRemoved(object sender, DockableWorkspaceCellEventArgs e)
        {
            e.CellControl.CloseAction -= WorkspaceCell_CloseAction;
            e.CellControl.BeforePageDrag -= WorkspaceCell_BeforePageDrag;
        }

        private void KryptonDockingManager_DockableWorkspaceCellAdding(object sender, DockableWorkspaceCellEventArgs e)
        {
            e.CellControl.CloseAction += WorkspaceCell_CloseAction;
            e.CellControl.BeforePageDrag += WorkspaceCell_BeforePageDrag;
        }

here docking events working for it