public static DefaultComparer <T> BindDefaultSearch <T>(RangeListView lv, string id, bool enableAlphaNum = false) { if (!_defaultSearches.ContainsKey(lv)) { _defaultSearches[lv] = new DefaultComparer <T>(enableAlphaNum); } DefaultComparer <T> comparer = (DefaultComparer <T>)_defaultSearches[lv]; lv.Dispatch(p => comparer.SetOrder(WpfUtils.GetLastGetSearchAccessor(lv) ?? id, WpfUtils.GetLastSortDirection(lv))); return(comparer); }