DocumentItemsSource - Same View is created for all ViewModel

Docking/MDI for WPF Forum

Posted 12 years ago by apeman
Version: 11.1.0541
The problem is: When binding ViewModels to the DocumentItemsSource of DockSite, only one instance of View is created for all ViewModels.

This behavior is similar to the standard TabControl, but it causes a lot of problems. I want to create a new instance of View for each ViewModel.

What workaround can I apply?


    <docking:DockSite Name="dockSite" 
                      DocumentItemsSource="{Binding DocumentItems}" 
                      DocumentItemContainerStyle="{StaticResource DocumentItemStyle}"                       
            <docking:TabbedMdiHost />
[Modified at 03/03/2011 06:34 PM]

[Modified at 03/03/2011 07:52 PM]

Comments (2)

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

Unfortunately, there really isn't a good workaround for this. You may be able to bind the DocumentItemsSource to a collection of Views, which you create from your ViewModels. But this really goes against the MVVM pattern.

We have a TODO item marked down to see about adding an option to load all child visuals, even the non-selected. I've added this forum post to that TODO item, so you will be notified when it's completed.

Actipro Software Support

Posted 12 years ago by apeman
Thanks, binding to a collection of Views works!
The latest build of this product (v22.1.3) was released 29 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.