public CategoryShowEditModel(ICategoryService service, IEventAggregator eventAggregator) { this.eventAggregator = eventAggregator; this.service = service; IsEditorEnabled = false; StartEditCategory = new DelegateCommand(OnStartEditCategory); CancelEditCategory = new DelegateCommand(OnCancelEditCategory); UpdateCategory = new DelegateCommand(OnUpdateCategory); OutlookCategoryEditStartedEvent categoryEditStartedEvent = eventAggregator.GetEvent <OutlookCategoryEditStartedEvent>(); categoryEditStartedEvent.Subscribe(CategoryEditStartedEventHandler, ThreadOption.UIThread, false, c => c != Category); OutlookTaskEditStartedEvent taskEditStartedEvent = eventAggregator.GetEvent <OutlookTaskEditStartedEvent>(); taskEditStartedEvent.Subscribe(CategoryEditStartedEventHandler); }
public TaskEditModel(ITaskService service, IEventAggregator eventAggregator, [Named("OutlookClientMapper")] IMapper mapper) { this.service = service; this.eventAggregator = eventAggregator; this.mapper = mapper; this.EditMode = false; this.originalTask = null; OutlookTaskEditStartedEvent taskEditStartEvent = eventAggregator.GetEvent <OutlookTaskEditStartedEvent>(); taskEditStartEvent.Subscribe(StartEdit, ThreadOption.UIThread, false, t => t == Task); taskEditStartEvent.Subscribe(OnCancelExecute, ThreadOption.UIThread, false, t => t != Task); OutlookCategoryEditStartedEvent categoryEditEvent = eventAggregator.GetEvent <OutlookCategoryEditStartedEvent>(); categoryEditEvent.Subscribe(OnCancelExecute); OkCommand = new DelegateCommand(OnOkExecute); CancelCommand = new DelegateCommand(OnCancelExecute); DeleteCommand = new DelegateCommand(OnDeleteExecute); this.DeleteConfirmation = new InteractionRequest <IConfirmation>(); }