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

五迷三道 提交于 2019-12-23 17:25:34

问题


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?


回答1:


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;
            }
        }
    }


来源:https://stackoverflow.com/questions/30667262/can-avalon-dock-floating-anchorables-be-more-independent-from-their-parent

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!