In a Silverlight application, drag a border control, and inside the border drop a rectangle. Somewhat like the image below. The question here is… Horizontal Alignment setting has a default value Stretch. How come it is behaving as if it is Center?
<Rectangle Height="71" Name="rectangle2" Stroke="Black" StrokeThickness="1" Width="101" />
In the code above, you can see I haven't specified Horizontal Alignment. Hence, it should be Stretch! But it doesn't appear to be so. As a matter of fact, if you explicitly set Width/Height property (typically happens if you drag and drop control), Stretch loses its significance. Hence, you should delete the width attribute in case you are looking for Stretch in HorizontalAlignment.
<Rectangle Height="71" Name="rectangle2" Stroke="Black" StrokeThickness="1" />
Read more about it here.
Hope this helps,
Rahul
Quote of the day:
When you are eight years old, nothing is any of your business. - Lenny Bruce