@ -1153,15 +1153,23 @@ namespace Avalonia.Collections
get { return GetItemAt ( index ) ; }
}
bool IList . IsFixedSize = > fals e;
bool IList . IsReadOnly = > true ;
bool IList . IsFixedSize = > SourceList ? . IsFixedSize ? ? tru e;
bool IList . IsReadOnly = > SourceList ? . IsReadOnly ? ? true ;
bool ICollection . IsSynchronized = > false ;
object ICollection . SyncRoot = > this ;
object IList . this [ int index ]
{
get = > this [ index ] ;
set = > throw new NotSupportedException ( ) ;
set
{
SourceList [ index ] = value ;
if ( SourceList is not INotifyCollectionChanged )
{
// TODO: implement Replace
ProcessCollectionChanged ( new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction . Reset , value ) ) ;
}
}
}
/// <summary>
@ -3992,9 +4000,36 @@ namespace Avalonia.Collections
}
}
int IList . Add ( object value ) = > throw new NotSupportedException ( ) ;
void IList . Clear ( ) = > throw new NotSupportedException ( ) ;
void IList . Insert ( int index , object value ) = > throw new NotSupportedException ( ) ;
int IList . Add ( object value )
{
var index = SourceList . Add ( value ) ;
if ( SourceList is not INotifyCollectionChanged )
{
ProcessCollectionChanged (
new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction . Add , value ) ) ;
}
return index ;
}
void IList . Clear ( )
{
SourceList . Clear ( ) ;
if ( SourceList is not INotifyCollectionChanged )
{
ProcessCollectionChanged ( new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction . Reset ) ) ;
}
}
void IList . Insert ( int index , object value )
{
SourceList . Insert ( index , value ) ;
if ( SourceList is not INotifyCollectionChanged )
{
// TODO: implement Insert
ProcessCollectionChanged (
new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction . Reset , value ) ) ;
}
}
void ICollection . CopyTo ( Array array , int index ) = > InternalList . CopyTo ( array , index ) ;
/// <summary>