How to make AvalonDock's floating child window dock when user double-clicks its title bar?

StackOverflow https://stackoverflow.com/questions/18323921

  •  25-06-2022
  •  | 
  •  

Pregunta

I am relatively new for AvalonDock 2.0 but I heard that one can change the behavior of title bar double-clicked in a floating child window with this new version. But I can't find any clue over Google or its own site. Is this even possible?

¿Fue útil?

Solución

I ended up modifying source of AvalonDock because it's just addition of 6 lines. If you know any better way, please post your answer.

In switch statement of FilterMessage method of LayoutAnchorableFloatingWindowControl.cs

            case Win32Helper.WM_NCLBUTTONDBLCLK:
                _model.Descendents().OfType<LayoutAnchorablePane>().First(p => p.ChildrenCount > 0 && p.SelectedContent != null).SelectedContent.Dock();
                break;

In switch statement of FilterMessage method of LayoutDocumentFloatingWindowControl.cs

            case Win32Helper.WM_NCLBUTTONDBLCLK:
                _model.RootDocument.Dock();
                break;
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top