diff --git a/Toolkit.Foundation/Insert.cs b/Toolkit.Foundation/Insert.cs index a9b29f1..e6808aa 100644 --- a/Toolkit.Foundation/Insert.cs +++ b/Toolkit.Foundation/Insert.cs @@ -2,9 +2,9 @@ public record Insert { - public static InsertEventArgs As(int index, TValue value) => - new(index, value); + public static InsertEventArgs As(int index, TSender sender) => + new(index, sender); - public static InsertEventArgs As(int index) where TValue : new() => - new(index, new TValue()); + public static InsertEventArgs As(int index) where TSender : new() => + new(index, new TSender()); } \ No newline at end of file diff --git a/Toolkit.Foundation/InsertEventArgs.cs b/Toolkit.Foundation/InsertEventArgs.cs index 00cac55..fd89cfc 100644 --- a/Toolkit.Foundation/InsertEventArgs.cs +++ b/Toolkit.Foundation/InsertEventArgs.cs @@ -1,3 +1,3 @@ namespace Toolkit.Foundation; -public record InsertEventArgs(int Index, TValue Value); \ No newline at end of file +public record InsertEventArgs(int Index, TSender Sender); \ No newline at end of file diff --git a/Toolkit.Foundation/ObservableCollection.cs b/Toolkit.Foundation/ObservableCollection.cs index 93f196a..e67025a 100644 --- a/Toolkit.Foundation/ObservableCollection.cs +++ b/Toolkit.Foundation/ObservableCollection.cs @@ -315,7 +315,7 @@ public partial class ObservableCollection : { if (Activated) { - if (args.Value is TItem item) + if (args.Sender is TItem item) { Insert(args.Index, item); }