views:

47

answers:

2

I've chosen Landscape only for my view in 800w x 480h available space. I want my app to be 600 (w) by 240 (h), absolutely sized. (There is a long story as to why this is, but it ain't gonna change - I don't want or need to fill all of the available space and need absolute sizing).

How can I center the app horizontally and vertically so that is its CenterX/Y is the same as the available space's CenterX/Y. I've tried VerticalAlignment="Center" HorizontalAlignment="Center" on both <phone:PhoneApplicationPage/> as well as <Grid/> and <Canvas/> tags - none of this works. Any thoughts on how I be able to center my app on screen?

+1  A: 

You could try with margins on the main grid:

Margin="100,120"

100 = (800-600)/2

120 = (480-240)/2

Olivier PAYEN
Hmmm...that's an interesting approach. It may just be the one I use. Will stand by for other answers for a bit and if nothing comes in that is part of the framework, will accept this one.
Otaku
No problem. I agree it's not a pretty solution but it has the merit of being simple.
Olivier PAYEN
Definetely, it has that going for it, easy to implement.
Otaku
A: 

Why not use a grid, and nest a grid inside with Width="600" and Height="240", with HorizontalAlign="Center" and VerticalAlign set to the counterpart?

dawmail333