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.
Unfortunately, activation email could not send to your email. Please try again.

How to get the new width and height of a dock panel when i resize?

Thread ID:

Created:

Updated:

Platform:

Replies:

133032 Oct 5,2017 12:07 AM Oct 9,2017 09:12 AM WPF 5
loading
Tags: DockingManager
Rathna Subramanian
Asked On October 5, 2017 12:07 AM

I am hosting an image control inside a dock panel. I need to scale the image control when I resize the dock panel(Progress bar should not appear). So is there a way to get the new height and width after resizing so that i can scale the image control? 
Thanks
Rathna Subramanian

Marimuthu Sivalingam [Syncfusion]
Replied On October 5, 2017 08:26 AM

Hi Rathna Subramanian,

Thank you for contacting Syncfusion support.

We can get the DockingWindow Height and Width after resizing the window by the help of "GetDesiredWidthInDockedMode" attached property of DockingManager. We have prepared the sample for the same. please download the sample from the below link.

Sample: DockingResizeHeight

Please find the below UG documentation link for more information about configuring the size of the docking window.

UG link: https://help.syncfusion.com/wpf/dockingmanager/dealing-with-windows#configuring-window-sizing

Regards,
Marimuthu S.
 


Rathna Subramanian
Replied On October 6, 2017 01:14 AM

Thank you so much. I am using DockingAdapter because i had to use caliburn micro.How to add these properties in the DockingAdapter?

Regards,

Rathna Subramanian


Marimuthu Sivalingam [Syncfusion]
Replied On October 6, 2017 08:42 AM

Hi Rathna Subramanian,

Thank you for your update.

We have analyzed your query and prepared the sample using caliburn.Micro to achieve this requirement. In this sample we have get the corresponding view of resized window by the help of VisualUtils.FindDescendant method (Visual tree helper) and WindowResizing event of DockingManager. You can find the WindowResizing event code snippet in DockingAdapterView class. please find the sample for the same from the below link.

Sample: DockingManagerMVVMCaliburnDemo

Regards,
Marimuthu S.


Rathna Subramanian
Replied On October 9, 2017 04:53 AM

Hi , 

 Thank You. The Window Resizing event is written in the code-behind of DockingAdapterView. But as per MVVM, we are not supposed to write any code in code behind. I tried to write the handle in the view model but i am not getting the source as  DockedElementTabbedHost. Please help. 


Marimuthu Sivalingam [Syncfusion]
Replied On October 9, 2017 09:12 AM

Hi Rathna Subramanian,

Thanks for your update.

We have checked your query with our DockingManager caliburn.micro sample. We can use the DockingManger named AdapterDockingManager in DockingAdapterViewModel. So we can hook window resizing event in DockingAdapterViewModel and get new size of resized Dock Window. Based on the size changes of Dock Window, please update the size properties you have used to set the size of your content view . Now we have modified the sample to hook the window resizing event in DockingAdapterViewModel and you can find the sample from the below link. 

Sample: DockingManagerMVVMCaliburnDemo

If we have misunderstood your query. Please provide simple sample with your requirement details. It would be more helpful to proceed further on this and provide the solution at the earliest.

Regards,
Marimuthu S.

 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;