FluidMoveBehavior with sortable ListBox RRS feed

  • Question

  • Hi I have a ListBox setup with the following behavior.

    The user can sort the items of the listbox as desired, but if I rebuild the ObservableCollection from scratch in the right order, then the fluid movement is lost because brand new UIElements are created. Is there a way to get around this ?

    In WPF the ObservableCollection class has a Move method, but I can find a way in Silverlight of doing in place sorting.

                    <ei:FluidMoveBehavior AppliesTo="Children" Duration="0:0:0.5">
                        <CubicEase EasingMode="EaseInOut" />
                        <CubicEase EasingMode="EaseInOut" />


    Tuesday, March 29, 2011 11:01 AM

All replies

  • Hello Clement,

    a while ago I wrote a short article about how to Sort an ObservableCollection(Of T) in Silverlight 3. Maybe this might help. Let me know if not.

    Best regards,


    Tuesday, March 29, 2011 2:10 PM
  • Martin, the issue is not to be able to actually sort the collection.

    The issue is how to make it play nice with the FluidMoveBehavior. It requires in place sorting rather than removing and re-adding items as you do in your example.

    Wednesday, March 30, 2011 3:44 AM