public void Handle(ComicRemoved eventData) { uiThread.Send(() => { var viewModel = Comics.SingleOrDefault(c => c.Id == eventData.Comic.Id); Comics.Remove(viewModel); }); }
public void Handle(ComicChanged eventData) { if (eventData.Comic.Status == Status.Inactive) { return; } uiThread.Send(() => { var viewModel = Comics.SingleOrDefault(c => c.Id == eventData.Comic.Id); if (viewModel == null) //in case the comic is removed before the ComicChanged event has fired. { return; } mapper.MapToViewModel(eventData.Comic, viewModel); Comics.ResetItem(Comics.IndexOf(viewModel)); }); }