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

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

@Dirkster99

Description

@Dirkster99

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 );

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