示例#1
0
 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
             });
         }
     }
 }
示例#2
0
        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
                    });
                }
            }
        }