元素自动调整位置System.Windows.Interactivity,Microsoft.Expression.Interactions

<Window x:Class="WpfApplication4.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525"
        xmlns:ei="clr-namespace:Microsoft.Expression.Interactivity.Layout;assembly=Microsoft.Expression.Interactions"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <Button Content="Add" Click="add_Click" Visibility="Hidden"/>
            <Button Content="Remove" Click="remove_Click" Visibility="Hidden"/>
        </StackPanel>
        <ListBox x:Name="listView" ItemsSource="{Binding}" Grid.Row="1">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Image Source="{Binding}" Height="80" Width="48" />
                </DataTemplate>
            </ListBox.ItemTemplate>
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <UniformGrid>
                        <i:Interaction.Behaviors>
                            <ei:FluidMoveBehavior AppliesTo="Children" Duration="0:0:0.5">
                                <ei:FluidMoveBehavior.EaseY>
                                    <!--<BackEase EasingMode="EaseInOut" />-->
                                    <QuarticEase EasingMode="EaseInOut" />
                                </ei:FluidMoveBehavior.EaseY>
                                <ei:FluidMoveBehavior.EaseX>
                                    <!--<BackEase EasingMode="EaseOut"/>-->
                                    <QuarticEase EasingMode="EaseOut" />
                                </ei:FluidMoveBehavior.EaseX>
                            </ei:FluidMoveBehavior>
                        </i:Interaction.Behaviors>
                    </UniformGrid>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>

    </Grid>
</Window>
原文地址:https://www.cnblogs.com/makubexsoft/p/2330929.html