Files
Walleby/Bitvault/ItemCommandHeaderViewModel.cs
T
2024-06-04 12:14:00 +01:00

32 lines
929 B
C#

using Toolkit.Foundation;
namespace Bitvault;
public partial class ItemCommandHeaderViewModel(ICollectionSynchronizer synchronizer,
IServiceProvider provider,
IServiceFactory factory,
IMediator mediator,
IPublisher publisher,
ISubscription subscriber,
IDisposer disposer,
IContentTemplate template) :
ObservableCollection(synchronizer, provider, factory, mediator, publisher, subscriber, disposer),
INotificationHandler<NotifyEventArgs<ItemCommandHeaderCollection>>
{
public IContentTemplate Template { get; set; } = template;
public Task Handle(NotifyEventArgs<ItemCommandHeaderCollection> args)
{
Clear();
if (args.Value is ItemCommandHeaderCollection commandCollection)
{
foreach (IDisposable command in commandCollection)
{
Add(command);
}
}
return Task.CompletedTask;
}
}