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

Layout.CollectGarbage is removing my empty pane #448

Open
furqansafdar opened this issue Aug 15, 2023 · 0 comments
Open

Layout.CollectGarbage is removing my empty pane #448

furqansafdar opened this issue Aug 15, 2023 · 0 comments

Comments

@furqansafdar
Copy link

furqansafdar commented Aug 15, 2023

So finally I have narrowed down the problem by investigating the issue in the AvalonDock code, but I am seeking assistance on my observation to figure out if it is a bug or my code issue.

So my XAML is the same as mentioned below. While calling LayoutInitializer I am attaching two of the anchorables to two panes, ErrorsPane and NotesPane but not attaching anything in FindPane. This anchorable is added to the pane when user press Ctrl + F keyboard shortcut but before even that while i am adding my Documents using DocumentsSource, the method DocumentsSourceElementsChanged in DockingManager class is fires and calling Layout?.CollectGarbage() which removes the empty panes. This is why I am lossing it.

<avalonDock:DockingManager
    x:Name="DockingManager"
    prism:RegionManager.RegionName="{x:Static fsx:RegionNames.TabRegion}"
    AnchorablesSource="{Binding Path=Anchorables}"
    Loaded="DockingManager_OnLoaded">
    <avalonDock:DockingManager.LayoutUpdateStrategy>
        <controls:LayoutInitializer />
    </avalonDock:DockingManager.LayoutUpdateStrategy>
    <LayoutRoot>
        <LayoutPanel Orientation="Horizontal">
            <LayoutPanel Orientation="Vertical">
                <LayoutDocumentPaneGroup>
                    <LayoutDocumentPane ShowHeader="False" />
                </LayoutDocumentPaneGroup>
                <LayoutAnchorablePaneGroup DockHeight="150" Orientation="Horizontal">
                    <LayoutAnchorablePane Name="ErrorsPane" />
                    <LayoutAnchorablePane Name="NotesPane" />
                </LayoutAnchorablePaneGroup>
            </LayoutPanel>
            <LayoutAnchorablePaneGroup x:Name="MyAnchorablePaneGroup" Orientation="Vertical">
                <LayoutAnchorablePane x:Name="FindPane" DockWidth="250" />
            </LayoutAnchorablePaneGroup>
        </LayoutPanel>
    </LayoutRoot>
</avalonDock:DockingManager>
@furqansafdar furqansafdar changed the title DockingManager LayoutRoot is not getting synchronized Layout.CollectGarbage is removing my empty pane Aug 17, 2023
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

1 participant