0

I have a three column grid with the following contents:

Column 1: Child Grid (Width: Specific)

Column 2: TextBox (Width: Auto)

Column 3: Child Grid (Width: Auto)

I was wondering, in pure XAML and with no behindcode, if it is possible to animate the third column to "grow" and the second column to "shrink" to fit it.

If behindcode is required for this, is there any chance someone could point me in the way of a VB method?

I have tried all the doubleanimations I can think of, and I have looked for a way of shrinking the textbox relative to its current width, which would might solve the problem, to no avail.

Thanks in Advance,

Freddy.

4

1 回答 1

1

列宽被定义为GridLengthnot double,这就是为什么你不会得到你正在寻找的任何DoubleAnimation变体的结果。没有内置的实现,但制作 aGridLengthAnimation并不难,并且有很多示例(尽管我不知道 VB 中的一个)。

这是一个例子: http: //marlongrech.wordpress.com/2007/08/20/gridlength-animation/

大多数代码都是样板文件,应该很容易让您自己在 VB 中编写,并且重要的部分(即GetCurrentValueCore)应该以非常小的更改进行翻译。

于 2013-02-12T19:13:47.527 回答