Hey,
I have a number of user controls in my system that I want to add in floating panes in the dock manager programatically. I want the floating pane to host the user control with the size that it appears in the designer (ie if I designed the user control 300x300 I want the user control to start as 300x300 when it's first shown). I also want to be able to resize the content pane and have the user control resize with the content pane.
I had a solution that sort of works for this:
1.) I create a dummy Border and set its height and width to the height and width of the user control2.) I set the user control's height and with to NaN.3.) I add both the dummy Border and the user control to a new Grid panel.4.) I set the Grid panel as the content of a new content pane.5.) I add the content pane to a split pane with its initial location set to floating only.6.) I add the split pane to the dock manager.
This solution is sort of a hack so if there's a better way to host user controls then I would rather use it.
Here's my problem with the above solution: if I have a XamDataGrid set to fill a user control and I bind data to that XamDataGrid, the floating pane resizes to show all of the rows in the xam data grid and all of the columns in the xam data grid. I would prefer that the floating pane only resize if the user explicitly resizes it.
This may be relevent: if I resize the pane at all before binding data to the XamDataGrid, then the pane won't resize when the XamDataGrid is bound.
Any help with this would be greatly appreciated.
Thanks
If you haven't set the attached XamDockManager.FloatingSize on the root split pane that you are floating then the size of the floating window will be based on the size of the content. If you have an element like a XamDataGrid or ListBox with lots of data then they are going to return a large desired size. Maybe what you should try doing is to use the XamDockManager.SetFloatingSize on the split pane using the Width/Height of the UserControl and then clear the Width/Height of the UserControl.
Thank you for your response,
I tried setting the floating size and it cuts off some of the size of the user control -- are the top/bottom/sides included in the floating size?
It depends on whether the floating pane is showing the OS chrome or not. There was an issue recently that might account for the floating window being a little smaller than it needs to be. This could account for the difference. That issue should be addressed in the next hotfix. If you want to ensure that that is the case then you should submit a small sample to the support group so they can write it up and we can verify if that is indeed addressed by the change I mentioned.