Ali_dotNet
Ali_dotNet

Reputation: 3279

Silverlight set stackpanel position center of screen

I'm using StackPanels in Silverlight 5 (VS2012), how can I center them in screen? is there any property (horizontalalignemt & verticalalignment do nothing), or should I center them using code?

Upvotes: 0

Views: 119

Answers (1)

Cem Sönmez
Cem Sönmez

Reputation: 516

You have to put stack panel in a container like Grid control then horizontal and vertical alignment properties should work.

<Grid x:Name="LayoutRoot" Background="White">
    <StackPanel Width="50" HorizontalAlignment="Right"> </StackPanel>
</Grid>

Upvotes: 1

Related Questions