DocumentItemsSource + ItemContainerRetentionMode not working as advertised?

Docking/MDI for WPF Forum

Posted 6 years ago by Jay Hill
Version: 14.1.0602
Platform: .NET 4.0
Environment: Windows 8 (64-bit)

I am currently evaluating Actipro Docking & MDI for my team. Each DocumentWindow will contain and needs to retain a relatively complex UI; it can't be recreated or re-bound each time a tab is selected.

I thought that using ItemContainerRetentionMode="Wrapped" on a DockSite, when binding DocumentItemsSource, would cause each tab in a TabbedMdiHost to retain its visuals and not have to be re-bound or re-instantiated when the tab is subsequently selected.

This does not appear to be the case when using nested <code>DockSites</code>. Instead, the view for the outer DocumentWindow is actually re-instantiated each time the tab selection is changed. Put another way, any changes to the inner DockSite are overwritten when switching tabs in the outer DockSite.

Without nested <code>DockSites</code>, the view only gets instantiated once (unless you raft or side-dock a tab), and then all the bound property getters are called each time the tab selection changes. I would have expected the view to be instantiated once per tab and then shown/hidden based on which tab is selected.

This docking solution is very slick, overall, and very close to what we are seeking, but I need to understand: are these known limitations (with workarounds, maybe), defects, or what?

I have screenshots and simple sample reproduction solutions for both scenarios that I can provide; I'm not sure where to E-mail them.


[Modified 6 years ago]

Comments (3)

Posted 6 years ago by Jay Hill

Whoops; looks like the <code> tag is supported in the editor (and it looks good there!), but not the output.

[Modified 6 years ago]

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Jay,

If you have related samples, please send them to our support address and be sure to rename the .zip file extension so it doesn't get spam blcoked.

The ItemContainerRetentionMode="Wrapped" feature effectively just creates a ContentControl that is instantiated to host the item content.  That visual remains alive as different tabs are selected.  The tabs themselves in MDI work like a regular TabControl where there is a strip of tabs and the selected tab's content is presented in a single ContentPresenter.  Then if that mode is active, the preexisting ContentControl for each tab gets swapped in and out of the ContentPresenter.  Maybe once we see your sample, we'll have an idea of where things might be going wrong in your scenario.

I'm not sure about the nested scenario without debugging it, but it doesn't sound like that should happen if you have the retention mode of wrapped set.

Actipro Software Support

Posted 6 years ago by Jay Hill

Thanks; I have sent the samples.

The latest build of this product (v2020.1.0) was released 23 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.