WPF Sizing of Panels

Posted by Mystagogue on Stack Overflow See other posts from Stack Overflow or by Mystagogue
Published on 2010-05-26T17:28:54Z Indexed on 2010/05/26 17:31 UTC
Read the original article Hit count: 407

Filed under:

I'm looking for an article or overview of WPF Panel types, that explains the sizing characters of each. For example, here are the panel types:

http://msdn.microsoft.com/en-us/library/ms754152.aspx#Panels_derived_elements

I've learned (by experiment) that UniformGrid can be given a fixed height, or it can be "auto" where it expands to fit available space. That is great, but what I wanted was for Uniform Grid to shrink to fit its internal content (particularly content that is provided dynamically, at run-time). I don't think it has that ability. So I'd like to know either what other Panel I could use for that purpose, or what Panel I should nest the UniformGrid inside of.

But I don't just want an answer to that specific question. I want the sizing dynamics and capabilities of all the Panel types, in summary form, so I can make all these choices as needed. Online I find articles that cover only half the Panel types, and don't give as much information about sizing as I'm describing.

Anyone know the link (or book) that has the info I'm seeking?

p.s. Since I want the UniformGrid to shrink to the dynamic content I'm providing, I could just keep track of the total height of controls placed within, and then set the height of the UniformGrid. But it would be nice if WPF took care of this for me.

© Stack Overflow or respective owner

Related posts about wpf