Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Adding ContentPane to a TabGroupPane programmatically and have it appear at the end
posted

Hi,

I've written some code for adding a ContentPane to a TabGroupPane. So far so good:

view.TabsGroup.Items.Add(contentPane);
view.TabsGroup.SelectedItem = contentPane;

where view.TabsGroup is a TabGroupPane and contentPane is a ContentPane.

The issue is that the new tab always appears at the beginning (e.g. it is always the leftmost), while I want them to appear at the end. I tried:

view.TabsGroup.Items.Insert(view.TabsGroup.Items.Count, contentPane);
view.TabsGroup.SelectedItem = contentPane;

but the issue persists. it appears that the order is not taken into account.

Any ideas?

Thanks,
Sam

Parents
  • 54937
    Offline posted

    This TabGroupPane must be within the DocumentContentHost. If so then this is the expected behavior. The TabGroupPane in the DocumentContentHost is designed to emulate the tabbed interface of VS and in VS when a pane is selected and is not in view then it will be moved into view (by making it the first tab item). The only way to prevent that would be to use a different ItemsPanel. By default the TabGroupPane in a DocumentContentHost uses our DocumentTabPanel which only creates elements for the tabs fully in view (as VS does). Note if you do use a different ItemsPanel (e.g. our TabItemPanel) you will likely alo need to retemplate the TabGroupPane since there will be no scroll elements in that template (since the tabbed interface doesn't support scrolling). Our default template has a key of TabGroupPane.DocumentTabGroupTemplateKey.

Reply Children