1

I'm trying to create an image slideshow just like this one on this page: http://forum.xda-developers.com/forumdisplay.php?f=1914 If you mouseover the image of the tablet, two arrows appear and you may slide through these images.

How to achieve this with wpf? I want to create it just like on the page, I press the right arrow and the current image moves left out of sight and the new image comes to the center from the right.

The application should be resolution independet, so working with a canvas isn't possible I guess.

4

1 回答 1

3

在不为您编写代码的情况下给出该问题的一般答案(这是您的任务):

创建Grid一个图像大小的图像。创建一个Canvas设置HeightProperty为图像的高度和WidthProperty宽度*数量的图像的总和。

接下来,将箭头和画布的两个图像添加到网格中并正确定位它们。

倒数第二件事。为网格创建一个事件,将箭头MouseEnter的属性更改为,并将其设置为。IsVisibletrueMouseLeavefalse

最后一件事。为两个箭头图像创建事件,LeftMouseButtonDown这将触发一个动画,该动画Margin.Left将画布的属性更改为一个图像的宽度。

于 2012-11-11T09:51:13.673 回答