简体   繁体   English

WP7如何用瓷砖制作菜单?

[英]WP7 how to make menu with tiles?

I am new to Silverlight and I believe my question is very simple, but haven't found an answer anywhere. 我是Silverlight的新手,我相信我的问题非常简单,但在任何地方都找不到答案。 So, I have an application and I want to make my menu to look like the tiles in WP7. 所以,我有一个应用程序,我想让我的菜单看起来像WP7中的瓷砖。 I have decided to use a button control for every tile, but I have the feeling, that this isn't the best decision. 我决定为每个瓷砖使用一个按钮控件,但我觉得这不是最好的决定。 When user clicks on a button, the button changes its design(background color, forecolor, etc.) to indicate, that it has been clicked. 当用户单击按钮时,该按钮会更改其设计(背景颜色,前景色等)以指示已单击该按钮。 On my WP7 the tiles are designed differently. 在我的WP7上,瓷砖的设计不同。 When user clicks on it, it kind of go downs(sinks) to indicate, that it has been clicked. 当用户点击它时,它会下降(下沉)以指示它已被点击。 So, my question is: Is there an easy way to simulate the natural Tiles behaviour, when they are clicked or I have to build my own behaviours on the button control? 所以,我的问题是: 有没有一种简单的方法来模拟自然Tiles行为,当它们被点击或我必须在按钮控件上构建我自己的行为?

Thanks in advance. 提前致谢。 Cheers. 干杯。

This effect is called the "Tilt effect": 这种效果称为“倾斜效应”:

The tilt effect for Windows Phone controls provides you with the ability to add additional visual feedback for control interaction. Windows Phone控件的倾斜效果使您能够为控件交互添加额外的视觉反馈。 Instead of having standard pressed or un-pressed states, controls with the tilt effect provide motion during manipulation. 具有倾斜效果的控制器在操纵期间提供运动,而不是具有标准的按压或未按压状态。 The result is a “tilt” like response when the control is touched. 结果是触摸控件时的响应“倾斜”。

Here is a link for an overview of the effect and here some sample code. 这是一个关于效果概述的链接这里有一些示例代码。

If you don't want your buttons to change colors when clicked, you can create a copy of the Button default template and edit it. 如果您不希望按钮在单击时更改颜色,则可以创建Button默认模板的副本并进行编辑。

Checkout TileSlider . Checkout TileSlider

TileSlider is a control for Windows Phone 7 that lets the developer present a tile in their app that behaves like the tiles when you pin a contact to the start menu. TileSlider是Windows Phone 7的一个控件,它允许开发人员在他们的应用程序中显示一个磁贴,当您将联系人固定到开始菜单时,该磁贴的行为类似于磁贴。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM