在Windows Phone 7中的位置

问题描述:





完全依赖Margin(0,0,0,0)来定义windows phone中的布局是不错的。如果没有,还有其他选项来定义布局。



任何人都可以建议我



问候

Hi,

Is it good to completely depend on Margin(0,0,0,0) for defining layout in windows phone. If not is there any other option to define layout.

Can anyone please suggest me

Regards

这实际上取决于您将元素放入的容器。您将使用三种不同类型的控件作为容器:



< Canvas>

< StackPanel>

<Grid>



我写了与Silverlight相关的每篇文章,但是示例中的代码与您今天在Windows 8应用程序中编写的内容相同。
It really depends on the container that you are placing your elements into. There are primarily three different types of controls that you will use as containers:

<Canvas>
<StackPanel>
<Grid>

I wrote each of those articles related to Silverlight, but the code in the examples is identical to what you would write in a Windows 8 application today.


更多专业你应该使用Grid控件的行和列定义属性。

这里有一个完整的例子:

http://msdn.microsoft.com/en-us/library/system.windows。 controls.rowdefinition(v = vs.95).aspx [ ^ ]



如果你觉得有用请不要忘记标记为解决方案。

问候
to be more professional you should use the row and column definition property of Grid control.
here is a complete example:
http://msdn.microsoft.com/en-us/library/system.windows.controls.rowdefinition(v=vs.95).aspx[^]

if you found that useful please don''t forget to mark as solution.
Regards