在 XAML 中动画网格列或网格行? [英] Animating Grid Column or Grid Row in XAML?

查看:28
本文介绍了在 XAML 中动画网格列或网格行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以从 XAML 为网格列宽或网格行高设置动画?

Is there any way I can animate Grid column width or Grid row height from XAML?

推荐答案

ColumnDefinition.WidthRowDefinition.Height 属性属于 GridLength 类型>,并且没有这种类型的内置动画.因此,如果您想这样做,您可能必须创建自己的 GridLengthAnimation 类.如果以 DoubleAnimation 为例,这可能不是太不可能,但也不容易...

The ColumnDefinition.Width and RowDefinition.Height properties are of type GridLength, and there is no built-in animations for this type. So if you want to do that, you will probably have to create your own GridLengthAnimation class. That's probably not too impossible if you take DoubleAnimation as an example, but not easy either...

实际上,如果您在 Google 上搜索GridLength 动画",会有几个有趣的结果...

actually, there are several interesting results if you search "GridLength animation" on Google...

http://windowsclient.net/learn/video.aspx?v=70654
http://marlongrech.wordpress.com/2007/08/20/gridlength-动画/
http://www.codeproject.com/KB/WPF/GridLengthAnimation.aspx

这篇关于在 XAML 中动画网格列或网格行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆