This is perhaps a silly question, but I can’t seem to find out how to do this.
I have a Silverlight app using Prism’s regions, and I have a requirement for an ‘expand’-type button inside one of my views. When the user clicks that button, I need the view to grow larger.
How do I change the size of my region dynamically, like this?
I’ve fooled around with setting the Height/Width properties of my view, and even grabbing ahold of my view’s Parent (which is the region, in this case — a ContentControl) and setting it’s Height/Width properties, to no avail.
I have multiple views in a grid and have no problem changing the size of rows or columns dynamically to vary the content. That probably means that you need to be changing the size of the parent of the ContentControl, rather than the content control itself.
The only requirement I found was that HorizontalAlignment=”stretch”, VerticalAlignment=”stretch” HorizontalContentAlignment=”stretch” and VerticalContentAlignment=”stretch” all need to be set on content controls (to stop the content collapsing).