0

我看到 [关于如何使用 Visual State Manager 更改按钮背景的一些问题][1]。但我想要的是一个可以像这样在 XAML 中使用的按钮

<Button NormalImage="/image/normal.png" PressedImage="image/pressed.png />

用户可以为 2 个按钮状态(正常和已按下)指定 2 个图像,当按钮被按下时,它使用 PressedImage。

怎么做 ?

4

1 回答 1

1

You would have to make your own user control and have those properties exposed as dependency properties so you are able to bind them.

In you user control, you can use the visual state manager to change the background when click/tap event is received

于 2012-12-11T15:49:27.503 回答