Files
Walleby/Bitvault/ItemCommandHeaderViewModel.cs
T
2024-05-27 16:08:18 +01:00

31 lines
872 B
C#

using Toolkit.Foundation;
namespace Bitvault;
public partial class ItemCommandHeaderViewModel(IServiceProvider provider,
IServiceFactory factory,
IMediator mediator,
IPublisher publisher,
ISubscription subscriber,
IDisposer disposer,
IContentTemplate template) :
ObservableCollection(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;
}
}