Transition between layout changes smoothly
Layout properties are typically set to discrete values (such as row or column numbers) or set to automatic values (such as width and height). To create a smooth transition between changes to these kinds of properties, use Fluid Layout. For example, if an object appears in the lower-left cell of a Grid layout panel in one state, but appears in the lower-right cell of that layout panel in a different state, the transition between those two states will result in an instant change unless you turn on Fluid Layout for the state group and increase the transition duration.
Note
Fluid layout affects only layout properties.
To transition between layout changes smoothly
In an open document, lay out your objects. For example, you might have a Grid object with three columns and three rows, with different objects in four of the cells.
In the States panel, define different visual states and change layout properties of your objects in the states. For example, for each of your objects, define a state that will display the object in the lower-right corner, spanning two rows and columns.
For information about creating states, see Define different visual states and transition times for a user control.
In the States panel, set the Default Transition time for your state group to 1 second.
Optionally, click EasingFunction to select an easing function to apply to the transition. Easing functions create a more realistic animation. For example, the Bounce easing function creates a bouncing effect.
To enable the change between states, open the Assets panel, select the Behaviors category, and drag the GoToStateAction behavior onto the object in the lower-left corner.
In the Properties panel, change the StateName property of the GoToStateAction to the name of the state that moves the lower-left object. For example, change the StateName property to Show1.
For more information about behaviors, see Working with behaviors.
Now that you have a working state transition, test your application by pressing F5 and clicking the object in the lower-left corner of the grid. It moves instantly to the lower-right corner, even though your transition time is 1 second.
In the States panel, click Turn on FluidLayout for your state group.
Test your application again by pressing F5 and clicking the object in the lower-left corner of the grid. It moves smoothly to the lower-right corner over the course of 1 second.
See also
Tasks
Define different visual states and transition times for a user control
Concepts
Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.