private void OnCloseFilmDetailTabExecute(object parameter) { if (parameter is IFilmDetailViewModel filmDetailViewModel) { FilmDetailViewModels.Remove(filmDetailViewModel); if (FilmDetailViewModels.Any()) { _mediator.Send(new SelectedMessage <FilmWrapper> { Id = FilmDetailViewModels.Last().Model.Id }); } } }
private void OnFilmDeleted(DeleteMessage <FilmWrapper> message) { var film = FilmDetailViewModels.SingleOrDefault(i => i.Model.Id == message.Id); if (film != null) { FilmDetailViewModels.Remove(film); if (FilmDetailViewModels.Any()) { _mediator.Send(new SelectedMessage <FilmWrapper> { Id = FilmDetailViewModels.Last().Model.Id }); } } }