I'm attempting to launch a SplitPane in the floating state with a default Height and Width. I've found that setting the Height and Width on the SplitPane causes problems. If I resize the floating pane, the inner content does not resize (stuck at the provided Height and Width). I've traversed the visual tree and discovered a ToolWindowHostWindow that contains the SplitPane. Setting the Height/Width on this does nothing, but settings Min Height/Width does work correctly.
Is there a way I can launch a floating SplitPane, manually set the Height and Width, and still get the content to resize as I shrink/expand the window? This is how the WPF Window class works, I want my floating panes to behave the same way.
The xamDockManager defines an attached property named FloatingSize which one can use (on the root/floating SplitPane) to set the size of the floating window.
Thanks for the quick response. Unfortunately, the FloatingSize attached property is not working in the context I need it to.
Here's my current setup:
It appear this attached property must be set before the SplitPane is loaded in the VisualTree? Any other advice for achieve a dynamic Height/Width on a floating SplitPane after it is loaded?
No setting the FloatingSize will change the size of the window even after it is loaded so either there is a timing issue - i.e. you're changing it while it's in the middle of loading/sizing in which case you might try using a BeginInvoke to asynchronously change it - or you're not getting to the root SplitPane which you can check because the LogicalTreeHelper.GetParent should be the ToolWindow if it is. Note, another way to alter the size of the window would be to get the ToolWindow (e.g. ToolWindow.GetToolWindow(this) where this is a control/element within the floating window and then just change its Width and/or height).