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

DockingManager: ModelChange event happens before new LayoutDocumentItem is added #11

Closed
Dirkster99 opened this issue Jan 21, 2019 · 1 comment

Comments

@Dirkster99
Copy link
Owner

Originally reported by https://github.com/striveprover

xceedsoftware/wpftoolkit#1430

When switched our project from .Net framework 4.6.1 to 4.7.2, the ApplyStyleToLayoutItem routine in Xceed.Wpf.AvalonDock.DockingManager causes a ModelChange event. Handling the event requires that the new LayoutDocumentItem is in the DockingManager's _layoutItems list. Unfortunately, the new LayoutDocumentItem is only added after ApplyStyleToLayoutItem completes.

The handler for ModelChange event in LayoutDocumentTabItem fails to set LayoutItem property and its CloseCommand no longer executes. Also, the item appears blank. Deselecting and reselecting allows its content to show, but does not fix the CloseCommand.

To be clear, we switched the .Net framework only in our projects and not in the Avalon dock project.

The fix appears to be to re-order the two lines (in two places) in Xceed.Wpf.AvalonDock.DockingManager.cs as shown below.

   _layoutItems.Add( layoutItem );
  ApplyStyleToLayoutItem( layoutItem );
Dirkster99 added a commit that referenced this issue Jan 21, 2019
The fixed order of the two lines (in two places) in Xceed.Wpf.AvalonDock.DockingManager.cs as shown below.

_layoutItems.Add( layoutItem );
ApplyStyleToLayoutItem( layoutItem );
@Dirkster99
Copy link
Owner Author

Issue fixed in version 3.4.11 of AvalonDock

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