Rich
Rich

Reputation: 735

AvalonDock : When using DocumentPane binding, the tabs for new DocumentContent items aren't clickable

I'm trying to bind a DocumentPane to the property ObservableCollection<DocumentContent> DocumentContent, using the xaml below.

<ad:DocumentPane Name="documentPane" ShowHeader="True" ItemsSource="{Binding Path=DocumentContent, Mode=OneWay}"></ad:DocumentPane>

My problem is that when a new DocumentContent object is added to the ObservableCollection, it adds the tab to the DocumentPane correctly, but the tab is not clickable.

Before I switched to data binding I was using document.Items.Add( new DocumentContent() ), which worked as expected.

Does anyone have any ideas why the tabs would not be clickable if they're added via data binding?

Upvotes: 1

Views: 1668

Answers (1)

Rich
Rich

Reputation: 735

I managed to fix this by moving the Binding to the parent DockingManager element, using DocumentsSource instead of ItemsSource. Fairly counter-intuitive, but it works.

Upvotes: 4

Related Questions