/// <summary>
        /// Occurs when RunWorkerAsync is called.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="DoWorkEventArgs"/> instance containing the event data.</param>
        private void LoadProductInventoriesBackground(object sender, DoWorkEventArgs e)
        {
            IProductInventoryRepository productInventoryRepository = new ProductInventoryRepository();

            BackgroundWorker source = (BackgroundWorker)sender;

            var results = productInventoryRepository.GetAllProductInventories();
            int index   = 0;

            foreach (var item in results)
            {
                Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { }));
                source.ReportProgress(++index, item);
            }
        }