public AddOrderWindow(IUnitOfWork unitOfWork, BorrowInfoDisplayViewModel borrowDisplayViewModel) { InitializeComponent(); _unitOfWork = unitOfWork; _borrowDisplayViewModel = borrowDisplayViewModel; readerComboBox.ItemsSource = _unitOfWork.ReaderRepository.Get(); bookComboBox.ItemsSource = _unitOfWork.BookRepository.Get().Where(x => LibraryHelper.IsInLibrary(x, _unitOfWork)); }
public BorrowWindow(IUnitOfWork unitOfWork) { InitializeComponent(); _unitOfWork = unitOfWork; _borrowInfoDisplayViewModel = new BorrowInfoDisplayViewModel(_unitOfWork); if (_borrowInfoDisplayViewModel.BorrowInfo.Any()) { DataContext = _borrowInfoDisplayViewModel; } else { borrowTable.Visibility = Visibility.Hidden; } }