Is FluidMoveBehavior available?

2019-05-10 05:22发布

问题:

I have calls to Grid.SetRow and Grid.SetColumn in my code which I'm trying to animate. According to the answer at http://social.msdn.microsoft.com/Forums/en-CA/wpf/thread/257779f7-b459-43fc-a4a1-f24641c50e09, it is recommended to make use of FluidMoveBehavior, but it doesn't look like this is available for Windows 8.

What are my options for animating the children of a Grid when their positions change? I'm basically looking for a way to achieve linear transition.

回答1:

There is a new built-in feature called Transitions that can be used, here is an intro. Try adding a RepositionThemeTransition to the grids ChildrenTransitions then items will animate when you change their row or column.

<Grid.ChildrenTransitions>
    <TransitionCollection>
        <RepositionThemeTransition/>
    </TransitionCollection>
</Grid.ChildrenTransitions>