wpftoolkit
wpftoolkit copied to clipboard
MVVM AvalonDock opening new documents doesn't show content
I have an MVVM application that adds documents to the LayoutRoot using a bound collection and an ILayoutUpdateStrategy.
If you open a document, then click on the tab header of the document, the next document you open will not display the document contents. The object is there, it is just not displayed. If you switch back to the original tab and back to the new one, the content is now displayed correctly, but clicking on the close button does not close the document.
I have found a workaround by setting the IsActive property of the LayoutDocument to true in the BeforeInsertDocument method of the ILayoutUpdateStrategy implementation, but this causes a Null Reference Exception under certain circumstances (which I will raise as a separate issue)
Hi, Can you submit your sample code so we can reproduce the same issue in order to fix it correctly ? You can always try the latest version v3.8 available for free for 45 days to see if it's already fixed(https://xceed.com/xceed-toolkit-plus-for-wpf/). Thank you.
Hi, This issue arose in our project after we updated to 4.3.0. For one type of document (and not any other type of document), the LayoutItem.View property is never retrieved and, consequently, the ContentPresenter is not created and no content is shown.
With the work-around suggested by michelle-barnett-89 the LayoutItem.View property is retrieved, the ContentPresenter is created and the contents shows as expected.
Attached is the call stack of a first invocation of LayoutItem.View for one of the unaffected documents.
Thank you
.