public BooksViewModel(
     IItemsService <Book> itemsService,
     IItemToViewModelMap <Book, BookItemViewModel> viewModelMap,
     IShowProgressInfo showProgressInfo, ILoggerFactory loggerFactory)
     : base(itemsService, viewModelMap, showProgressInfo, loggerFactory)
 {
 }
        public MasterDetailViewModel(
            IItemsService <TItem> itemsService,
            IItemToViewModelMap <TItem, TItemViewModel> viewModelMap,
            IShowProgressInfo showProgressInfo,
            ILoggerFactory loggerFactory)
            : base(showProgressInfo)
        {
            _itemsService = itemsService ?? throw new ArgumentNullException(nameof(itemsService));
            _viewModelMap = viewModelMap ?? throw new ArgumentNullException(nameof(viewModelMap));
            _logger       = loggerFactory?.CreateLogger(GetType()) ?? throw new ArgumentNullException(nameof(loggerFactory));

            _logger.LogTrace("ctor MasterDetailViewModel");

            _itemsService.SelectedItemChanged += ItemsService_SelectedItemChanged;

            _itemsService.Items.CollectionChanged += (sender, e) =>
            {
                RaisePropertyChanged(nameof(Items));
            };

            _itemsService.PropertyChanged += ItemsService_PropertyChanged;

            RefreshCommand = new DelegateCommand(OnRefresh);
            AddCommand     = new DelegateCommand(OnAdd);
        }