@@ -15,11 +15,11 @@ namespace WinUI.TableView;
1515/// <summary>
1616/// A collection view implementation that supports filtering, sorting, and incremental loading.
1717/// </summary>
18- internal partial class CollectionView : ICollectionView , ISupportIncrementalLoading , INotifyPropertyChanged , IComparer < object >
18+ internal partial class CollectionView : ICollectionView , ISupportIncrementalLoading , INotifyPropertyChanged , IComparer < object ? >
1919{
2020 private IList _source = default ! ;
2121 private bool _allowLiveShaping ;
22- private readonly List < object > _view = [ ] ;
22+ private readonly List < object ? > _view = [ ] ;
2323 private readonly ObservableCollection < FilterDescription > _filterDescriptions = [ ] ;
2424 private readonly ObservableCollection < SortDescription > _sortDescriptions = [ ] ;
2525 private CollectionChangedListener < CollectionView > ? _collectionChangedListener ;
@@ -259,7 +259,7 @@ private void HandleFilterChanged()
259259 }
260260 }
261261
262- var viewHash = new HashSet < object > ( _view ) ;
262+ var viewHash = new HashSet < object ? > ( _view ) ;
263263 var viewIndex = 0 ;
264264 for ( var index = 0 ; index < _source . Count ; index ++ )
265265 {
@@ -442,7 +442,7 @@ public void CopyTo(object[] array, int arrayIndex)
442442 /// </summary>
443443 /// <param name="item">The item to locate in the collection.</param>
444444 /// <returns>The index of the item if found in the collection; otherwise, -1.</returns>
445- public int IndexOf ( object item )
445+ public int IndexOf ( object ? item )
446446 {
447447 return _view . IndexOf ( item ) ;
448448 }
@@ -464,7 +464,7 @@ public void Insert(int index, object item)
464464 /// </summary>
465465 /// <param name="item">The item to move to.</param>
466466 /// <returns>true if the operation is successful; otherwise, false.</returns>
467- public bool MoveCurrentTo ( object item )
467+ public bool MoveCurrentTo ( object ? item )
468468 {
469469 return item == CurrentItem || MoveCurrentToIndex ( IndexOf ( item ) ) ;
470470 }
@@ -520,7 +520,7 @@ public bool MoveCurrentToPrevious()
520520 /// </summary>
521521 /// <param name="item">The item to remove.</param>
522522 /// <returns>true if the item was successfully removed; otherwise, false.</returns>
523- public bool Remove ( object item )
523+ public bool Remove ( object ? item )
524524 {
525525 if ( IsReadOnly ) throw new NotSupportedException ( "Collection is read-only." ) ;
526526
0 commit comments