New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent DockPanel resizing when parent from resizes #92
Comments
Up! |
Can anybody help? |
It is currently marked as a bug. Patch is welcome. |
Hi, |
The current design is that all panes maintain their original width in terms of a percentage rather than by pixel value. I'm sure this decision was originally made to simplify the resizing logic. This issue will remain open to improve the existing behavior. I believe it should work as follows:
|
Can you suggest a workaround? |
So far, there is no workaround. |
I have found the location where the hide window rectangle is being calculated which finally sets the size of the window in the auto hide mode. it's in Dockpanel.AutohideWindow.cs at get of property AutoHideWindowRectangle. There we do have if/else if sections differing between the different docking areas. There the code currently uses ActiveAutoHideContent.DockHandler.AutoHidePortion as a proportion factor for the percentage of the dock window size relative to the parent window. That factor is the same for all docking positions. |
I have a suggestion for changing the behaviour as mentioned above and would like to ask the maintainers to check and comment if that's a reasonable solution for I have by far not the full overview over the entire framework: In file DockPanel.AutoHideWindow.cs, property AutoHideWindowRectangle I have added 'autoHideSize = DockLeftPortion;' into the if block and the set 'autoHideSize' to other values in the other if block respectively.
(commented line are the original lines, uncommented lines are the suggested lines) Same applies with the other code blocks of the same function with the other values such as DockRightPortion etc. with these two functions modified, I do get the wanted behaviour. The desired behaviour yet does only become active only when you initialize the DockLeftPortion, DockRightPortion, etc. with values larger than 1. Yet the suggestion remains to be evaluated by those who have more profound knowledge about the details of the framework. |
The best way is to fork, hack, and share with us a pull request. |
Sorry guys, I have some trouble doing that with IE8, moreover I have no admin priviledges to do an upgrade. Firefox got filtered out in some way with https. Therefore, all I can do is dropping the code fragments right here. By the way, I have done the following modifications based on version 2.7 in these two functions: in file DockPanel.AutoHideWindow.cs I have modified the following functions:
|
I have created a new branch and made the suggested changes, https://github.com/dockpanelsuite/dockpanelsuite/tree/gh92 We might perform necessary review on the changed behaviors and see if it is ok to be included in either 2.8 or 3.0. |
Visual studio maintains independent sizes for the docked and autohide states (which I find useful), so we shouldn't give up that functionality. It's handy to be able to give the autohide windows different sizes. |
I don't believe a bug exists with the core of these questions (there's a little bit of funny business being handled by another issue). By default, the left/right/top/bottom dock areas of the DockPanel are defined to take up 25% of the total width (for left/right) or height (for top/bottom). This is defined by the four properties:
If the value is less than 1, the sizing will be treated in percentage terms (ie, 0.25 is use 25% of the available size). The description of these properties in the designer explain this behavior. |
Hi,
How can I prevent DockPanel resizing when parent from resizes?
For example, I start my form in normal state (it occupies about half of the screen) and then open my bottom DockPanel "Output" - the latter has height, say, 100 (nominal units).
Then - with "Output" DockPanel still open - I maximize my form; DockPanel's height grows from 100 to, say, 120. But I want its height to remain unchanged. How can I do this?
Thank you.
The text was updated successfully, but these errors were encountered: