This project is read-only.

DockableContent Close

Sep 14, 2009 at 6:10 PM

Hi,

I want to be able to close DockableContents and not hide them. I don't see a way to do it. I figured these are meant to be used in specific cases but wouldn't it be nice to be able to close them when needed and not have them in memory?

Thanks.

PS: I have a class derived from DockableContent and this class holds a reportviewer. The user of my system can instantiate this derived class and can a view a report that he/she chooses. I want to give the users the flexibility to dock these report windows to any side of its parent and be able to unpin/minimize/hide it. When the user closes this window, I don't want to keep them in memory.

Sep 14, 2009 at 6:41 PM
Hi,
latest build from SVN has the property HideOnClose for the DockableContent class. Setting it to false (by default is true), the dockable content will be disposed instead of simply hidden.
If you don't want to download the latest version SVN, consider that I'm about to make the stable release 1.2.2641.
Thanks,
Ado

From: sg
Sent: Monday, September 14, 2009 7:10 PM
To: [email removed]
Subject: DockableContent Close [AvalonDock:68890]

From: sg

Hi,

I want to be able to close DockableContents and not hide them. I don't see a way to do it. I figured these are meant to be used in specific cases but wouldn't it be nice to be able to close them when needed and not have them in memory?

Thanks.

PS: I have a class derived from DockableContent and this class holds a reportviewer. The user of my system can instantiate this derived class and can a view a report that he/she chooses. I want to give the users the flexibility to dock these report windows to any side of its parent and be able to unpin/minimize/hide it. When the user closes this window, I don't want to keep them in memory.

Sep 14, 2009 at 7:01 PM
Edited Sep 15, 2009 at 3:34 PM

Thanks for the quick response Ado and I am sure that the HideOrClose property would be very useful not just to me but everybody else.

Thanks.

Sep 15, 2009 at 3:55 PM

Hi Ado,

The HideOnClose property setting is still not working as expected. I could see issues in the following methods:

DockableFloatingWindow.OnClosed(), DockableFloatingWindow.OnExecuteCommand(), DocumentPane.ExecutedCloseCommand(), FlyoutDockablePane.Close()

Thanks,

sg.

Sep 22, 2009 at 12:23 PM
<!-- Body{font-family: Verdana; font-size: 0.75em;}#ThreadNotificationFooter{border-top: 1px solid #ccc; color: gray;}#ThreadNotificationPostBody{Margin-Bottom: 2em;} pre { 1.25em; } -->
Hi sg,
HideOnClose should now works correctly on latest build 1.2.2648
Ado

 

Sep 22, 2009 at 6:48 PM

Hi Ado,

Everything works fine except for dockablecontents in flyout panes.

To reproduce:

1. Set HideOnClose to false

2. Dock a DockableContent to any side of the docking manager

3. Unpin the pane

4. Open the flyout pane by hovering the mouse over it

5. Click close without pinning the pane.

Thanks,

sg

Nov 26, 2009 at 10:38 AM
Edited Nov 26, 2009 at 11:06 AM

First of all - thanks for great control.

I need to make some actions when DockableContent is closed. But in now in my opinion it is impossible. What do you thing about:

  1. Add to DockingManager method public void Close(DockableContent content) (there is already Hide(...) method).
  2. In Pane class change CloseOrHide(...) methods signatures to protected.
  3. Add to DockingManager class factory methods:
    • protected virtual CreateDockablePane()
      { 
      	return new DockablePane();
      }
      
    • protected virtual CreateDockableFloatingWindow(DockablePane dockablePane)
      { 
      	return new DockableFloatingWindow(this, dockablePane);
      } 
      
    • protected virtual CreateDockableFloatingWindow(DockablePane dockablePane)
      { 
      	return new DockableFloatingWindow(this, dockablePane);
      }
      
    Use this methods in Show(...).

Thanks.