Skip to content

FluidMoveBehavior

branh edited this page Dec 4, 2018 · 1 revision

FluidMoveBehavior allows a component to move smoothly between two positions.

This behavior causes a UI element to move smoothly over the course of Duration between its old and new position as defined by the easing functions EaseX and EaseY. The element may float between containers unless FloatAbove is set to false.

This behavior applies over some AppliesTo scope as long as IsActive is true. Depending on the Tag, the location may be determined by some binding to a TagPath or by the data context. An InitialTag and InitialTagPath allow for different behavior when the element is first loaded.

FluidMoveScope enumeration

Member Name Description
Self Applies only to the UI element itself.
Children Applies to all of the UI element's children. Useful for lists.

TagType enumeration

MemberName Description
Element Location determined by element.
DataContext Location determined by element's binding to a data context.

SampleCode

Xaml

<StackPanel>
  <Behaviors:Interaction.Behaviors>
    <Behaviors:FluidMoveBehavior Duration="00:00:01" AppliesTo="Children">
      <Behaviors:FluidMoveBehavior.EaseY>
        <BounceEase EasingMode="EaseOut" Bounces="2" />
      </Behaviors:FluidMoveBehavior.EaseY>
    </Behaviors:FluidMoveBehavior>
  </Behaviors:Interaction.Behaviors>
</StackPanel>