在 Windows Phone 全景控件中控制自动生成的内容演示者的边距
我正在构建 MVVM Panorama Windows Phone 7 应用程序。
在全景项目布局的某个点,我得到全景标题框的下边距,这将我的内容向下移动得太远。有没有办法设置 ContentPresenter
的下边距,生成该内容以容纳 Panorama.HeaderTemplate
中定义的控件?
这是我在 Silverlight Spy 中的布局列表:
如果屏幕截图不可读,这里有一个大版本: http://bit.ly/rBvNp8
某些东西为标题框生成 26 点的底部边距(可能是控件的代码,处理布局)。我怎样才能控制这个值?我需要将其设置为 0。
I am building an MVVM Panorama Windows Phone 7 application.
At some point of Panorama Item's layout I get a bottom margin of a panorama header box, that moves my content too far down. Is there a way I can set a bottom margin of a ContentPresenter
, that is generated to hold the controls, defined in the Panorama.HeaderTemplate
?
Here is my layout list in Silverlight Spy:
In case the screen shot is not readable, here is a large version:
http://bit.ly/rBvNp8
Something generates a 26 points bottom margin for a header box (probably the control's code, that handles a layout). How can I control this value? I need it to be set to 0.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了控制
ContentPresenter
的属性,需要重新定义 PanoramaItem 的默认模板(在样式设置器内)。在我的特定情况下,它是PanoramaItem
的样式。设置 Margin="10,-2,0,0" 就可以了。
In order to control a
ContentPresenter
's properties one needs to redefine the default template (within a style setter) for the PanoramaItem. In my particular case it isPanoramaItem
's style.Setting Margin="10,-2,0,0" does the trick.