This project is read-only.

On Windows XP clicking on X button of a DockablePane closes all DockableContents inside it

Nov 19, 2010 at 10:02 AM

Hello, great Docking Library but im having an issue im not able to solve on my own.

Supposed normal behavior:

If i run the library in a 32bit/64bit process on Windows Vista or Windows 7 and i click the close Button ("X") on a DockablePane containing at least 2 DockableContents only the selected DockableContent gets closed.

Issue:

If i run on WindowsXP, click on the same Button closes the entire DockablePane with all DockableContents inside. I did a bit of debugging and i suppose there is a CloseCommand routing issue.

Tried AvalonDock-62498 and AvalonDock-62949, both Net 4.0 and Net 3.5.

Was able to reproduce the issue with included Sample 2:

- Run the sample on Windows XP

- Click on  Menu Dockable Contents->Create New at least 2 times

- Click "X" Button on the right docked Pane and all but the LogWindow will get closed

Nov 19, 2010 at 10:16 AM
Edited Nov 19, 2010 at 12:38 PM

This Workaround seems to do fine:

 

       private void DockableContent_Closing(object sender, CancelEventArgs e)
        {
            DockableContent dc;

            dc = (DockableContent)sender;
            if (dc.State == DockableContentState.Docked)
            {
                if (dc.ContainerPane.SelectedItem != dc)
                    e.Cancel = true;
            }
       }

 

Jan 6, 2011 at 9:56 AM
danielbruske wrote:

This Workaround seems to do fine:

 

       private void DockableContent_Closing(object sender, CancelEventArgs e)
        {
            DockableContent dc;

            dc = (DockableContent)sender;
            if (dc.State == DockableContentState.Docked)
            {
                if (dc.ContainerPane.SelectedItem != dc)
                    e.Cancel = true;
            }
       }

 

 The workaround seems to be working only if the active DockableContent was the last item in the Dockable Pane. If the active content the first item, it closes and the next item becomes the selected item in the ContainerPane and hence it also closes. Likewise the all the subsequent Dockable Contents get closed.