Make it possible to gather values using scoped ItemConfiguration
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
namespace Toolkit.Foundation;
|
||||||
|
|
||||||
|
public interface ICollectionSynchronization<TItem>;
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Toolkit.Foundation;
|
||||||
|
|
||||||
|
public static class ICollectionSynchronizationExtensions
|
||||||
|
{
|
||||||
|
public static int IndexOf<TItem>(this ICollectionSynchronization<TItem> synchronization,
|
||||||
|
TItem item) => synchronization is IList<TItem> collection ? collection.IndexOf(item) : -1;
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Toolkit.Foundation;
|
namespace Toolkit.Foundation;
|
||||||
|
|
||||||
public interface IIndexable
|
public interface IIndexed
|
||||||
{
|
{
|
||||||
public int Index { get; }
|
public int Index { get; }
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Toolkit.Foundation;
|
||||||
|
|
||||||
|
public interface IKeyed<T>
|
||||||
|
{
|
||||||
|
public T Id { get; }
|
||||||
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace Toolkit.Foundation;
|
|
||||||
|
|
||||||
public interface ISynchronizationCollection<TItem>
|
|
||||||
{
|
|
||||||
int IndexOf(TItem item);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace Toolkit.Foundation;
|
namespace Toolkit.Foundation;
|
||||||
|
|
||||||
@@ -140,4 +141,11 @@ public partial class Observable<TKey, TValue> : Observable
|
|||||||
Key = key;
|
Key = key;
|
||||||
Value = value;
|
Value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
partial void OnValueChanged(TValue? value) => OnValueChanged();
|
||||||
|
|
||||||
|
protected virtual void OnValueChanged()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ public partial class ObservableCollection<TItem> :
|
|||||||
IList,
|
IList,
|
||||||
IReadOnlyList<TItem>,
|
IReadOnlyList<TItem>,
|
||||||
INotifyCollectionChanged,
|
INotifyCollectionChanged,
|
||||||
ISynchronizationCollection<TItem>,
|
ICollectionSynchronization<TItem>,
|
||||||
IServiceProviderRequired,
|
IServiceProviderRequired,
|
||||||
IServiceFactoryRequired,
|
IServiceFactoryRequired,
|
||||||
IMediatorRequired,
|
IMediatorRequired,
|
||||||
|
|||||||
Reference in New Issue
Block a user