Search code examples
c#avalondock

How to switch between document tabs in AvalonDock 2


I have build a little app that uses AvalonDock 2. I bound my view models to the docking manager, can create and remove documents, all fine. However, there is one thing I do net get to work: When I have multiple documents open I am not able to make a specific document tab the active and visible tab (like if I would click on the tab header) from code.

I have bound to the "ActiveContent" property and set it to the document I want to be the active and visible one, but that does not help.

Can please someone give me some advice on how to do that?


Solution

  • After some research it turned out to be a trivial task. The actual problem is lack of documentation on such trivial tasks. So here for all others who fight with the same problem, the answer:

    Each LayoutItem has a property named IsSelected. By setting its value to 'true', the tab representing the LayoutItem is switched into view.