tags:

views:

9

answers:

1

I have a grid layout that splits a view into two parts, effectively for two sets of headings and list. I want each list to share the height of the active view evenly so I've used proportional sizing:

In the case where both lists exceed the height available this works just fine. However, if the top list only has 1 or two items, it sizes nicely to the space it needs, however the second list does not use all of the remaining space, it only uses 50% of the original screen size when I'd like it to use whatever's left if the first list doesn't need half.

I could use a Dock Panel and let the last row fill, but in cases where the first list is large I want it limitted proportionally, not a fixed max height.

Does anyone know if the grid supports this, or if there is some combination to acheive this that will work with scrolling if the available size is not sufficient for both lists, ensuring the lists share available space evenly?

A: 

If I'm understanding you correctly, then I can't think of a way to make the sizing decisions with WPF's pixel/proportional/star/auto sizing options...

But perhaps you could make it work in the code-behind, by getting the ActualHeight/ActualWidth properties, then calculating your MaxHeight/MaxWidth/Height/Width based on the proportions you want.

ewall