In WPF, has anybody animated a Grid?

前端 未结 7 1886
走了就别回头了
走了就别回头了 2020-12-11 00:32

I have 2 columns in a Grid. When I click a button, I want the first column to animate to the left from it\'s current position to 0. So, in effect, it collapses and I\'m le

7条回答
  •  执念已碎
    2020-12-11 01:08

    You can also achieve this with GridLength animation , see an example here http://marlongrech.wordpress.com/2007/08/20/gridlength-animation/ Using this approach you can manipulate any given Grid.Column or Grid.Row size.

    For your special need just put first column with Width="Auto" and second with *, animate the with of the content inside the first column- that will do the trick.

提交回复
热议问题