这是indexloc提供的服务,不要输入任何密码
Skip to content

Trying dock a floating window inside a document pane leads to its disappearing of window's content. #138

@cuellius

Description

@cuellius

I use this xaml:

    <avalondock:DockingManager x:Name="DockManager" Grid.Row="2" Margin="0,0,0,0">
        <avalondock:LayoutRoot x:Name="MainLayoutRoot">
            <avalondock:LayoutPanel x:Name="LayoutPanelHost" Orientation="Vertical">
                <avalondock:LayoutDocumentPaneGroup x:Name="MainLayoutDocumentPaneGroup">
                    <avalondock:LayoutDocumentPane x:Name="InitialDocumentsPane">
                        <!-- here documents added in code -->
                    </avalondock:LayoutDocumentPane>
                </avalondock:LayoutDocumentPaneGroup>
            </avalondock:LayoutPanel>
        </avalondock:LayoutRoot>
    </avalondock:DockingManager>

In code I add documents (two or greater):

//DocumentViewer is my class, the class is derived from LayoutDocument
var dw = new DocumentViewer(); 
InitialDocumentsPane.Children.Add(dw);

I make floating the one document, then dock in inside this document, after this it do not dock, but disappears.

Reason: DocumentViewer is not fully class LayoutDocument, it is derived.

Fixing: class DocumentPaneDropTarget (file DocumentPaneDropTarget.cs), method protected override void Drop(LayoutDocumentFloatingWindow floatingWindow), switch (Type), case DropTargetType.DocumentPaneDockInside, replace loop

foreach (var anchorableToImport in layoutDocumentPaneGroup.Descendents().OfType<LayoutContent>()
 .Where(item => allowedDropTypes.Contains(item.GetType())).ToArray())

with

foreach (var anchorableToImport in layoutDocumentPaneGroup.Descendents().
 Where(d => d is LayoutDocument || d is LayoutAnchorable).OfType<LayoutContent>().ToList())

I am sorry, because I am very stupid and don't know how to create pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions