diff --git a/ILSpy/Docking/DockWorkspace.cs b/ILSpy/Docking/DockWorkspace.cs index cc69c7bdac..3ad6aaf83d 100644 --- a/ILSpy/Docking/DockWorkspace.cs +++ b/ILSpy/Docking/DockWorkspace.cs @@ -123,11 +123,9 @@ public void AddTabPage(TabPageModel tabPage = null) public ReadOnlyObservableCollection TabPages { get; } - public ReadOnlyCollection ToolPanes => exportProvider - .GetExportedValues("ToolPane") - .OrderBy(item => item.Title) - .ToArray() - .AsReadOnly(); + private ToolPaneModel[] toolPanes = []; + + public ReadOnlyCollection ToolPanes => toolPanes.AsReadOnly(); public bool ShowToolPane(string contentId) { @@ -183,6 +181,12 @@ public void InitializeLayout() AddTabPage(); } + toolPanes = exportProvider + .GetExportedValues("ToolPane") + .OrderBy(item => item.Title) + .ToArray(); + OnPropertyChanged(nameof(ToolPanes)); + DockingManager.LayoutUpdateStrategy = this; XmlLayoutSerializer serializer = new XmlLayoutSerializer(DockingManager); serializer.LayoutSerializationCallback += LayoutSerializationCallback;