Skip to content

Commit

Permalink
finish ObservableSet and CiccioSet
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoCrimi committed Sep 6, 2024
1 parent 7646590 commit 8071d3a
Show file tree
Hide file tree
Showing 19 changed files with 2,883 additions and 281 deletions.
10 changes: 7 additions & 3 deletions Runtime/Collections/BindingCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ public class BindingCollection<T> : ListBase<T>, IList<T>, IList, IReadOnlyList<

#region Constructors

public BindingCollection() => Initialize();
public BindingCollection()
{
Initialize();
}

public BindingCollection(IEnumerable<T> collection) : base(collection)
{
Expand All @@ -40,6 +43,7 @@ public BindingCollection(IEnumerable<T> collection) : base(collection)

public BindingCollection(int capacity) : base(capacity)
{
Initialize();
}

private void Initialize()
Expand All @@ -51,7 +55,7 @@ private void Initialize()
raiseItemChangedEvents = true;

// Loop thru the items already in the collection and hook their change notification.
foreach (T item in items)
foreach (T item in _list)
{
HookPropertyChanged(item);
}
Expand All @@ -67,7 +71,7 @@ protected override void ClearItems()
{
if (raiseItemChangedEvents)
{
foreach (T item in items)
foreach (T item in _list)
{
UnhookPropertyChanged(item);
}
Expand Down
Loading

0 comments on commit 8071d3a

Please sign in to comment.