Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cuellius opened this issue Mar 17, 2020 · 0 comments

Comments

@cuellius
Copy link
Contributor

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.

Dirkster99 added a commit that referenced this issue Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants