Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Avalon Dock floating anchorables be more independent from their parent?

Tags:

wpf

avalondock

I have an AvalonDock DockingManager control with some child Anchorables (no Documents). If these Anchorables are floated from the main DockingManager, I'm aware they are still part of the DockingManager's logical tree.

However, I've had some requests from users that the floating windows be more independent from the main window by "disabling" some features:

  • When any window (parent or child) is focussed, all windows are brought to the front
  • When the parent window is minimised, so are all floating child windows.

I'm completely stumped as to how I could go about this, short of editing the AvalonDock source (which I'd rather not do given the option).

Is there a way to do either of these things?

like image 584
Philip C Avatar asked Dec 19 '25 08:12

Philip C


1 Answers

Set the property Owner of a floating window to null to detach it from its logical parent.

{
  dockManager.LayoutUpdated += DockManager_OnLayoutUpdated;
}

 private void DockManager_OnLayoutUpdated(object sender, EventArgs e)
 {
        foreach (var floatingWindow in dockManager.FloatingWindows)
        {
            if (floatingWindow.Owner != null)
            {
                floatingWindow.Owner = null;
            }
        }
    }
like image 198
Jozef Kosik Avatar answered Dec 21 '25 22:12

Jozef Kosik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!