Add contextual commands
This commit is contained in:
@@ -1,33 +1,25 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Toolkit.Foundation;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class ItemViewModel :
|
||||
ObservableCollection<IDisposable>
|
||||
{
|
||||
[ObservableProperty]
|
||||
private int? id;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool immutable;
|
||||
|
||||
public ItemViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
IContentTemplate template,
|
||||
bool immutable = true,
|
||||
int? id = null,
|
||||
string? name = null) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
IContentTemplate template) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
Template = template;
|
||||
Id = id;
|
||||
Immutable = immutable;
|
||||
|
||||
Add<ItemHeaderViewModel>(immutable, name ?? "");
|
||||
Publisher.Publish(Notify.As(Factory.Create<CommandCollection>(new List<IDisposable>
|
||||
{
|
||||
Factory.Create<EditItemActionViewModel>(),
|
||||
Factory.Create<ArchiveItemActionViewModel>(),
|
||||
})));
|
||||
}
|
||||
|
||||
public IContentTemplate Template { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user