WPF动画的scrollviewer的孩子被scrollviewer剪辑。

时间:2021-12-04 14:08:26

Hey folks, I'm hoping I have a fairly simple problem that can be fixed easily as it seems like I'm just missing something basic from the WPF world. I have a scrollviewer wrapping a stackpanel which contains several images, these images have animations to increasing in size when the mouse passes over them. All works fine without the scrollviewer, now I've added the scrollviewer, the animation works but only inside the scrollviewer; the increasing size isn't being allowed to overlap the scrollviewer.

嘿,各位,我希望我有一个相当简单的问题,可以很容易地解决,因为看起来我只是错过了WPF世界中的一些基本东西。我有一个scrollviewer包装一个stackpanel,它包含几个图像,这些图像有动画,当鼠标经过它们时,它们的大小会增加。在没有scrollviewer的情况下,所有的工作都很好,现在我添加了scrollviewer,它只在scrollviewer中工作;增加的大小不允许重叠scrollviewer。

Is there a way to fix this? Thanks, Becky

有办法解决这个问题吗?谢谢你,贝基

1 个解决方案

#1


1  

It's the way ScrollViewer works. Basically it always clips to bounds even if you set ClipToBounds="False" on it.

这就是ScrollViewer的工作方式。基本上,即使你在上面设置了ClipToBounds="False",它也会一直保持在界限之内。

To make it work and continue using ScrollViewer you'll have to animate images on top of it, not inside.

要使其工作并继续使用ScrollViewer,您将必须在它的顶部有动画图像,而不是在里面。

#1


1  

It's the way ScrollViewer works. Basically it always clips to bounds even if you set ClipToBounds="False" on it.

这就是ScrollViewer的工作方式。基本上,即使你在上面设置了ClipToBounds="False",它也会一直保持在界限之内。

To make it work and continue using ScrollViewer you'll have to animate images on top of it, not inside.

要使其工作并继续使用ScrollViewer,您将必须在它的顶部有动画图像,而不是在里面。