Children structures do not work properly.


Let's say that I have this project:
LayoutDocumentPane centralLayout = new LayoutDocumentPane();
LayoutAnchorGroup leftLayout = new LayoutAnchorGroup();
LayoutAnchorGroup rightLayout = new LayoutAnchorGroup();
LayoutAnchorGroup topLayout = new LayoutAnchorGroup();
LayoutAnchorGroup bottomLayout = new LayoutAnchorGroup();
LayoutRoot layoutRoot = new LayoutRoot();
LayoutPanel layoutPanel = new LayoutPanel();
LayoutDocumentPaneGroup pg = new LayoutDocumentPaneGroup();

layoutRoot.RootPanel = layoutPanel;
dockManager.Layout = layoutRoot;
LayoutAnchorSide l = new LayoutAnchorSide();
layoutRoot.LeftSide = l;
LayoutAnchorSide r = new LayoutAnchorSide();
layoutRoot.RightSide = r;
LayoutAnchorSide t = new LayoutAnchorSide();
layoutRoot.TopSide = t;
LayoutAnchorSide b = new LayoutAnchorSide();
layoutRoot.BottomSide = b;
Then I insert five LayoutAnchorables
The thing is, I cannot figure out how detecting when a window is closed. I thought registering my layoutAnchorables on a list and then when a propertychange event rises, and checking the list and the LayoutAnchorGroups or layoutroot children would do the trick!, but it did not. The number of children changes when I able and disable “autohide”. If I close a windows “layoutroot” children grows! I think that internal Registers must be reviewed. Although I understand that it is beta, maybe the authors did not notice this behavior.
Thanks, and good job


adospace wrote May 29, 2012 at 12:59 PM

Hum, I don't know which is the issue here. The LayoutRoot children collection can increase if you hide windows when the Hidden group is automatically created. Also this can happen if you float an anchorable for the first time.

Could you please explain better what you're trying to achive? and also please use this section to post reproducible issues only, thx

cvilachap wrote May 30, 2012 at 8:58 AM

Well, what I see is dockingmanager.layoutrood.children grows when I close panels. In fact, in my case I have 5 LayoutAnchorables, and when I close all, dockingmanager.layoutrood.childrenoncount says 8.

adospace wrote May 30, 2012 at 1:23 PM

yes, because hidden anchorables became children of the root, if you close them instead of hide you should see that root children count is not changed

cvilachap wrote May 31, 2012 at 2:01 PM

As I said, I close the panels.

adospace wrote Jun 1, 2012 at 8:22 PM

Hi, sorry I was not clear. I suppose you clicked the x button. Doing so you only hide the panes, which means that the anchorables are removed from main layout and are placed niside the Hidden collection (becoming in this way children of the LayoutRoot). If you instead click the Close menu item you explitely remove any reference to the anchorables object.
Please let me know If you need more info

wrote Feb 22, 2013 at 2:22 AM