ReInitialization of view while docking or floating that tolwindow(having that view).

Docking/MDI for WPF Forum

Posted 12 years ago by keshav bansal
Version: 12.1.0560
Avatar

Hi,

I am able to register the view as the toolwindow using the prismIntegration but when i float that toolwindow it is reinitializing the view or it is again calling the constructor of that view. Is it the docking design to recreate the view inside the toolwindow when it is docked or floated or whole toolwindow is recreated ?

But for the simple docking application if i am adding the custom toolwindow in the docksite and float that docksite then after floating that tool window it is not reinitializing the view(toolwindow) or it is not  calling the constructor of that view(toolwindow).

[Modified 12 years ago]

Comments (3)

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

Hi Keshav,

By default our tool windows work just like the native WPF TabControls.  Tool window containers all have a single ContentPresenter, which shows the content of the selected tab.  New tool window containers are created dynamically as needed when docking states change, although in some cases they might be reused.  Thus, when the view model is moved around to various docking/floating locations, new views are created when new tool window containers are made or the view model is moved into another existing tool window container.

We do have a special property named DockSite.ItemContainerRetentionMode to help retain the generated view visuals though, which might help you out.  Please read our documentation topic called "MVVM Features", and the info for this is near the bottom.


Actipro Software Support

Posted 12 years ago by keshav bansal
Avatar

As i set the ItemContainerRetentionMode to Wrapped then still is calling the ReInitializing .

I am able to register the view as the toolwindow using the prismIntegration but when i float that toolwindow it is reinitializing the view or it is again calling the constructor of that view. Is it the docking design to recreate the view inside the toolwindow when it is docked or floated or whole toolwindow is recreated ?

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

Hi Keshav,

The ItemContainerRetentionMode should work if you are using our Prism Interop assembly. It uses DocumentItemsSource and ToolItemsSource under the hood when you add items to the DockSite region, and should retain the view visual while the view model is still registered.  That view should end up being reused as it is docked around.

If you are seeing differently then please make a new simple sample project and email it to our support address so we can debug it.  Rename the .zip file extension so it doesn't get spam blocked.


Actipro Software Support

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.