Treeviews selection / expanding states are lost when moved or hidden through dock features

Docking/MDI for Avalonia Forum

Posted 13 days ago by Guillaume CHAFFAROD - Developper, Clever-Age
Version: 25.2.0
Platform: .NET 8
Environment: Windows 11 (64-bit)
Avatar

Add a simple treeview in ToolWindow (for example) contained in a DockSite. Make the treeview Selectionmode="Multiple" (to ensure all cases are checked).

Add items in the treeview through ItemsSource, but don't bind SelectedItems and let the treeview manage itself items expand state (expand and selection is not managed by view models).

Expand and select many nodes of the tree.

Move this toolwindow (make it float, pin it, hide it if not pinned) => Only root nodes are visible (all other are collapsed) and selection is lost.

Comments (1)

Posted 13 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

The only thing that would really change behavior from being in a docking window is that if you move the docking window, inherited data contexts from above the docking window would change due to the logical and visual trees being altered.  I'm assuming you may be binding to something using an inherited data context in this case.

The problem and the workaround for that are described in the Troubleshooting documentation topic.  Please check that out and let us know if it helps resolve the problem.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.