views:

270

answers:

1

In general, how does one set a control to take up the entire Height and Width of its container? I am new to Silverlight and was surprised that the controls don't have a Dock property (unless I am missing something).

+3  A: 

If you set the Width and Height using the Star "*" notation it will occupy as much space that is "left" in the container. Setting the Height and Width to "Auto" will make the control use as much space as is needed to display the contents of what is in the control.

Joseph
I got an exception on several controls, saying it does not recognize *, while it did work on others (e.g. grid/row definitions)
AngryHacker
@AngryHacker For controls that don't support the star notation, setting the property to "Auto" will cause the control to fit to it's container.
Joseph