Ghost1372

everything can be handy

Behaviors

FluidMoveBehavior

1
2
3
4
5
6
7
8
9
<StackPanel x:Name="Panel" Grid.Row="0">
<hc:Interaction.Behaviors>
<hc:FluidMoveBehavior Duration="00:00:01" AppliesTo="Children">
<hc:FluidMoveBehavior.EaseY>
<BounceEase EasingMode="EaseOut" Bounces="2" />
</hc:FluidMoveBehavior.EaseY>
</hc:FluidMoveBehavior>
</hc:Interaction.Behaviors>
</StackPanel>

now add items:

1
2
3
4
5
6
Rectangle rect = new Rectangle();
rect.Height = 50;
rect.Width = 50;
rect.Fill = Brushes.DeepPink;
rect.Margin = new Thickness(5.0);
this.Panel.Children.Add(rect);

or remove items:

1
2
3
4
if (this.Panel.Children.Count > 0)
{
this.Panel.Children.RemoveAt(0);
}

MouseDragElementBehavior

1
2
3
4
5
<Rectangle Width="40" Height="40" Fill="DeepPink">
<hc:Interaction.Behaviors>
<hc:MouseDragElementBehavior/>
</hc:Interaction.Behaviors>
</Rectangle>
0%