public NoteItemViewModel(NoteModel model, IApi api, UIHost uiHost) : base(model.Id, api, uiHost) { FolderId = model.FolderId; ToggleFlagCommand = new AsyncRelayCommand(ToggleFlag); MoveToFolderCommand = new AsyncRelayCommand <Guid>(MoveToFolder); Update(model); Api.EventBus.Subscribe <NoteUpdatedEvent>(x => Update(x.Model), x => x.Model.Id == Id); Api.EventBus.Subscribe <NoteFlagChangedEvent>(x => IsFlagged = x.IsFlagged, x => x.Id == Id); }
public void Register(IExtendedCommand command) { _commands.Add(command.Id, command); }
public void Register(string id, IExtendedCommand command) { _commands.Add(id, command); }