Make it possible to gather values using scoped ItemConfiguration
This commit is contained in:
@@ -1,24 +1,19 @@
|
||||
using Toolkit.Foundation;
|
||||
using System.ComponentModel;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class ItemEntryViewModel<TKey, TValue>(IServiceProvider provider,
|
||||
public partial class ItemEntryViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
ISynchronizationCollection<IItemEntryViewModel> synchronization,
|
||||
ItemEntryConfiguration configuration,
|
||||
TKey? key = default,
|
||||
TValue? value = default) :
|
||||
Observable<TKey, TValue>(provider, factory, mediator, publisher, subscriber, disposer, key, value),
|
||||
IHandler<ConfirmEventArgs<ItemContentEntry>, (int, ItemEntryConfiguration)>,
|
||||
IItemEntryViewModel,
|
||||
IIndexable
|
||||
string? key = default,
|
||||
object? value = default) :
|
||||
Observable<string, object>(provider, factory, mediator, publisher, subscriber, disposer, key, value),
|
||||
IItemEntryViewModel
|
||||
{
|
||||
public int Index => synchronization.IndexOf(this);
|
||||
|
||||
public Task<(int, ItemEntryConfiguration)> Handle(ConfirmEventArgs<ItemContentEntry> args,
|
||||
CancellationToken cancellationToken) => Task.FromResult((Index, configuration with { Value = Value }));
|
||||
protected override void OnValueChanged() => configuration.Value = Value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user