We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Docking Manager MVVM and Caliburn.Micro Support

Is DockingManager capable of working in sync with Caliburn.Micro framework and MVVM ?  Is there any workaround for that ?

10 Replies

VJ Victory Jessie Selvam D Syncfusion Team December 2, 2014 12:16 PM UTC

Hi Mahesh,

Thank you for using Syncfusion products.

Query: Is DockingManager capable of working in sync with Caliburn.Micro framework and MVVM? Is there any workaround for that ?
DockingManager doesn't support direct MVVM so we have achieved it by creating a wrapper or adapter for it. Please refer the following link for adapting DockingManager to an MVVM application,
http://www.syncfusion.com/blogs/post/MVVM-Adapter-for-WPF-Docking-Manager.aspx

We have prepared a work around sample for DockingManager with Caliburn.Micro framework and MVVM, kindly download it from the attachment. 

Please let us know if you need further assistance on this.

Regards,
Jessie

Attachment: DockingManagerMVVMCBM_dd67c3ef.zip


MN MAHESH NARAYANAN V V December 4, 2014 06:25 AM UTC

Thanks for your quick Support.

I found a problem in your solution.  when I add a children during run time (example  : create new property window for dynamically created object ) with docking State As Dock its not displaying. State other 

than dock is working fine and if I create a child with Autohidden state change the  state to dock its hidden from the UI but the child is there in DockingManager.Children.




VJ Victory Jessie Selvam D Syncfusion Team December 5, 2014 01:03 PM UTC

Hi Mahesh,

Thank you for your update.

We have modified the sample by adding the Properties window in Dock state and ClassView window in AutoHidded state dynamically. We are unable to reproduce the reported issues with the attached sample. Kindly provide us more details by modifying the sample if the reported issue is reproduced in your scenario.

Please let is know if you need further assistance on this.

Regards,
Jessie

Attachment: DockingManagerMVVMCBM_19a543d5.zip


MN MAHESH NARAYANAN V V December 10, 2014 12:09 PM UTC

Hai,

   you solution cannot be considered as a perfect MVVM pattern because, if i need to change any property of docked window dynamically I need to do it in traditional way and even it is difficult to find out the exact window that I am looking for. The Idea is  as MVVM pattern suggest if the properties in IChildrenElement is changed the docking window's property should also change. For example , I should be able to change the header of a floating window by changing the Header property in IChildrenElement 


VJ Victory Jessie Selvam D Syncfusion Team December 12, 2014 10:50 AM UTC

Hi Mahesh,

Thank your for your update.

We have modified the sample by data binding the Header and State attached properties so that changes in these properties for IChildrenElement will reflect in docking child windows. And in the sample commands are provided under Add menu to add child in Dock & AutoHidden state and to change the Header & State properties programmatically at run time. If we have misunderstood your requirement kindly provide us more details so that we can proceed further to assist you.

Please let us know if you need further assistance on this.

Regards,
Jessie

Attachment: DockingManagerMVVMCBM_f6c42fe.zip


MN MAHESH NARAYANAN V V January 13, 2015 10:25 AM UTC

Yes. This may work. 
Can you please give update for the very previous solution (DockingManagerMVVMCBM_19a543d5.zip) ? 


MN MAHESH NARAYANAN V V January 14, 2015 06:22 AM UTC

Hi, 
    Can you give an effective way to find or track all child windows. My requirement is to retrieve any window during run time to modify its properties . 


VJ Victory Jessie Selvam D Syncfusion Team January 19, 2015 06:13 AM UTC

Hi Mahesh,

Thank you for your update.

Query: Can you please give update for the very previous solution?
We have modified the sample to add children in Dock and AutoHidden state dynamically to MVVM pattern. In the sample, commands are provided under Add menu to add child in Dock & AutoHidden state. Also we are unable to reproduce the reported issues with the attached sample. 

Query: Can you give an effective way to find or track all child windows. My requirement is to retrieve any window during run time to modify its properties?. 
In the attached sample, you can track the child windows by using the DockingAdapterViewModel.DockingAdapter property in MenuViewModel class. It is the collection of IChildrenElement that are added in DockingManager. Also under the Add menu we have added a menu item "Change header" and clicking on this will change the Header property of all child windows based on their order in DockingManager. We would like to know more details like modified sample if we have misunderstood your requirement.

Please let us know if you need further assistance on this.

Regards,
Jessie

Attachment: DockingManagerMVVMCBM_9b15e3b.zip


MN MAHESH NARAYANAN V V January 28, 2015 05:38 AM UTC

Caliburn.Micro Support  :
   
Why docking window doesn't render view according to view model if we doesn't specify the DataTemplate in app.xaml. If we are going in Caliburn.Micro 's way Its the frameworks job to render the view according to viewmodels. The extra configurations seems to be extra coding. Can you please work on this and get me a good solution to support Caliburn.Micro completely in Docking Manager


VJ Victory Jessie Selvam D Syncfusion Team January 29, 2015 11:52 AM UTC

Hi Mahesh,
 
Our WPF Docking Manager is not an item control, it is not possible to have a traditional item-source binding to a collection of objects in the view model. However we have achieved it by creating an adapter for DockingManager. So it is necessary for mapping the DataTemplates with ViewModels in App.xaml file.
 
Please let  us know if you need further assistance on this.
 
Regards,
Jessie

Loader.
Live Chat Icon For mobile
Up arrow icon