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
40
Binding to ItemsSource of TabGroupPane
posted

Hi,

In my application I have a DockManager that contains the following piece of code:

Now I want to use data binding to occupy the TabGroupPane with instances of UserControls.

So in my C# code I have an ObservableCollection (DocumentsList) that contains UserControls.

Now I want to bind this collection to the ItemsSource of TabGroupPane.

I do this by using the following code:

 

This code works and when I add multiple UserControls to the ObservableCollection they are being shown:

But when I am trying to use a document (like switching between the documents) it won't work and ik get errors (Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead.)

Am I doing something wrong or is it just not possible?!

Kind Regards,

Arjan

  • 54937
    Offline posted

    BInding the ItemsSource of a TabGroupPane is not supported. The xamDockManager needs to be able to manipulate the items collection since panes can be moved, floated, unpinned, etc.