I'm having an issue, wherein after I close the last tab in the dock manager, attempting to create/open a new one doesn't appear to be working.
I've attached a sample project that illustrates the problem. After you have started the project, click the "Add Control" button. This Will cause a new tab to be created, the content of which is the custom control.
Then close the tab by clicking the small "X" on the tab, so that the dock manager is empty again.
Finally, click the "Add Control" button again, and note that no new tab appears.
Am I missing something obvious?
Further to that, restart the project and click "Add Control" to create a tab. Then double-click on the tab to cause the tab window to float. Then click on the "Add Control" button again, and note that no new tab appears.
Something else obvious that I'm missing?
I'm using the SL4 11.2 versions of the controls.
Thanks!
That's perfect! I had a feeling it was something simple I was missing.
Thanks for the incredibly quick reply!
Hi,
the issue here is that when you close the pane the TabGroupPane is also removed from the DocumentContentHost's panes(because it has no panes). That's why adding a pane to the tabGroupPane does nothing. So you modify your "Add Control" click handler to be something like this:
private void button1_Click(object sender, RoutedEventArgs e) { if (!host.Panes.Contains(tabGroupPane)) { host.Panes.Add(tabGroupPane); } ContentPane item = new ContentPane(); item.Content = new cntrlNewControl(); item.Header = "NewControl"; item.PinButtonVisibility = Visibility.Visible; tabGroupPane.Panes.Add(item); }
Hope this helps,