Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
345
ContentPane Sizing
posted

There seems to be some inconsistency regarding ContentPane sizing withing a DockManager depending on the content inside it. E.g. if I put a RichTextbox as the content it starts out with the correct size and resizes nicely when the main window resizes. But with a grid as the content it doesn't start out with the right size and only sizes to a smaller size correctly.

I have a demo app that can illustrate the issue better. http://jacquers.wajas.de/temp/uidemo.zip and http://jacquers.wajas.de/temp/uidemo.wmv (content 03 is the one that resizes correctly)

Maybe there is a property that I'm missing or something that will make the content pane resize correctly?

 

 

Parents
  • 54937
    Verified Answer
    Offline posted

    When you have a root splitpane that has no constraint the pane gets measured with the available size (which in this case is the amount of space left after arranging the outer panes). The grid or other elements do the right thing and measure their content with that constraint and return a value indicative of the amount of space needed for their content given that constraint. However the richtextbox is "greedy" about its width measurement and basically it will return the width that it is measured with. You can see what I mean if you create a plain wpf window, put a richtextbox in it and set the SizeToContent to WidthAndHeight. When you run it the window will be as wide as your working area (i.e. the width of your screen(s)). The default arrangement of the dockmanager is akin to VS where the root docked panes are docked around a central content. If you are not using any Content for the xamDockManager and you want the panes to fill the available area then you would set the LayoutMode (added in 10.1) to FillContainer.

Reply Children
No Data