Search code examples
datatemplatewpftoolkitavalondock

Wrapping AvalonDock tab contents with AdornerDecorator


Validation errors disappear when tabs are changed in AvalonDock. Therefore, I need to change tab content template in AvalonDock to wrap the content with AdornerDecorator. But I don't know how to do this.


Solution

  • I solved this problem, but do not delete the question since it can be useful for others. This is the solution:

    <ad:DockingManager>
        <ad:DockingManager.LayoutItemTemplate>
            <DataTemplate>
                <AdornerDecorator>
                    <ContentControl Content="{Binding}"/>
                </AdornerDecorator>
            </DataTemplate>
        </ad:DockingManager.LayoutItemTemplate>
    </ad:DockingManager>