public UpdateSort ( IComparer | ||
comparer | IComparer | The comparer to use; null if no sort is to be applied. |
return | void |
public void UpdateSort(IComparer<object> comparer)
{
if ((_comparer == null) && (comparer == null)) {
return;
}
object currentItem = null;
if (IsCurrencyEnabled && (_snapShot != null)) {
currentItem = CurrentItem;
}
_comparer = comparer;
_snapShot = null;
if (currentItem != null) {
EnsureSnapShot();
int index = _snapShot.IndexOf(currentItem);
CurrentIndex = index;
RaisePropertyChanged("CanMovePrevious");
RaisePropertyChanged("CanMoveNext");
}
UpdateVersion();
RaiseCollectionReset();
}