public void Handle(AddItemMessage message) { Item item = (Item)ActivateHelper.Activate(message.ItemType); Model.EquipmentHierarchy.AddItem(item); Publish(new ProjectChangedMessage()); }
public void HandleExternalAddItemMessage(AddItemMessage msg) { using (var scope = _lifetimeScope.BeginLifetimeScope()) { var dataService = scope.Resolve <IDataService>(); dataService.AddItem(msg.Item); } }
void IListener <AddItemMessage> .Handle(AddItemMessage message) { EventAggregator.SendMessage(new LogMessage("Add new item: " + message.ItemType.Name)); }