XAML for floating window in AvalonDock

Can someone provide me with a piece of AvalonDock XAML code that, when launched, opens a floating window application instead of always docking inside the dock panel? I saw programmatic ways to do this, but I thought there should be a way to specify it in XAML. Thanks...

+4
source share
1 answer

I know this is a little late, but hopefully this will help someone with the same problem in the future ...

To create a floating document, add LayoutDocumentFloatingWindow as a child of LayoutDocumentFloatingWindow, and then add LayoutDocument as a child of LayoutDocumentFloatingWindow, as shown below:

<xcad:DockingManager> <xcad:LayoutRoot> <xcad:LayoutRoot.FloatingWindows> <xcad:LayoutDocumentFloatingWindow> <xcad:LayoutDocument Title="My Document"> <!--Add document content here--> </xcad:LayoutDocument> </xcad:LayoutDocumentFloatingWindow> </xcad:LayoutRoot.FloatingWindows> </xcad:LayoutRoot> </xcad:DockingManager> 

Similarly, you can add the bindings like this:

 <xcad:DockingManager> <xcad:LayoutRoot> <xcad:LayoutRoot.FloatingWindows> <xcad:LayoutAnchorableFloatingWindow> <xcad:LayoutAnchorablePaneGroup> <xcad:LayoutAnchorablePane> <xcad:LayoutAnchorable Title="My anchorable"> <!--Add anchorable content here--> </xcad:LayoutAnchorable> </xcad:LayoutAnchorablePane> </xcad:LayoutAnchorablePaneGroup> </xcad:LayoutAnchorableFloatingWindow> </xcad:LayoutRoot.FloatingWindows> </xcad:LayoutRoot> 

Please note that unlike LayoutDocuments for binding, you need to add a panel of groups, and not just one LayoutAnchorable, because floating bindings are intended for grouping in one window, but LayoutDocuments is not.

As a more general guide, you can find an example of setting varioius layout elements in DockingManager: https://xceed.com/wp-content/documentation/xceed-toolkit-plus-for-wpf/AvalonDock.html

+2
source

Source: https://habr.com/ru/post/1390354/


All Articles