Sunday, August 22, 2010

LightSwitch Custom Controls Sizing

When I was working on my last post I couldn't figure out how to get my custom control to auto size when the screen was resized. After looking at this a little closer I found the trick to doing this. First in the custom control's XAML change the column sizes so they are relative.

<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />

After you have re-built the control return to the designer for the CreateNewEmployee screen. Click on the Name control and then scroll to the bottom of the properties list and set the Content Size to Stretch.


Now the textboxes in the custom control will stretch when the page is re-sized.

No comments: