#988 – Enabling Live Sorting in a CollectionViewSource

By default, when you’re using a CollectionViewSource to do sorting, grouping and filtering in a list-based control, the sorting/grouping/filtering behavior will only updated when you explicitly refresh the CollectionViewSource (by calling Refresh) or when you add or remove something to the collection.

You can enable live sorting in the CollectionViewSource to cause it to resort items when one or more properties on the bound objects change.  In the example below, we set the IsLiveSortingRequested property to true and specify that the Actor.LastName property is the property to live sort on.

        <CollectionViewSource x:Key="cvsActors" Source="{Binding ActorList}"
                <scm:SortDescription PropertyName="LastName" />

Now when we make a change to the last name of one of the actors, the sorting is updated.