Known issues:
Works only on controls that are children of a Canvas
Controls are the same size
Will be fixed in future updates
Microsoft.Xaml.Behaviors
Compile ReoderBehavor
project to get the dll or take the Reordering.cs
class and implement it to any of your projects.
To use reorderingbehavor in XAML you need to declare namespaces for ReorderingBehavior assembly and xaml.behaviors
xmlns:reorder="clr-namespace:ReoderBehavior;assembly=ReoderBehavior"
xmlns:I="http://schemas.microsoft.com/xaml/behaviors"
Attach the behavior to a control (must be a child of Canvas)
<Rectangle Canvas.Left="250" Canvas.Top="20">
<I:Interaction.Behaviors>
<reorder:Reordering/>
</I:Interaction.Behaviors>
</Rectangle>
Add Reordering.cs
to your project or ReorderingBehavior.dll
assembly to dependencies.
using ReoderBehavior;
using Microsoft.Xaml.Behaviors;
C# code
Button b = new Button();
Reordering reorder = new Reordering();
mainCanvas.Children.Add(b);
reorder.Attach(b);
Interaction.GetBehaviors(b).Add(reorder);