Sep 17, 2008 17:01
For anyone who was wondering, here is how I solved the problem. First, any time the window is resized I set the base grid's width and height equal to the client width and height, which I get by using interop to do my Win32 call to GetClientRect. Then I set the window's minimum width and height equal to the sum of the minimum widths/heights of my grid contents plus the difference between the values I get from GetWindowRect and GetClientRect.
When I drag a gridsplitter, I handle the DragDelta event. When I get a DragDelta, I set the MaximumSize of the pixel-sized grid piece (ColumnDefinition or RowDefinition) I'm dragging equal to the total grid size minus the min sizes of the other pixel-sized rows/cols minus the actual size of the star-sized rows/cols. I also set those maximum sizes when the whole window/grid is resized.
Additionally, when the window is resized I compare each DefinitionBase's actual size to its maximum size, and if it's bigger I set it equal to the maximum size with pixel sizing.
There are also min sizes set on all my DefinitionBases. If anyone is interested let me know and I can explain better or send you a code snippet.
wpf