protected virtual void OnBetsAdded(BetsAddedEventArgs e)
 {
     if (BetsAddedEventHandler != null)
     {
         BetsAddedEventHandler(this, e);
     }
 }
        private void BetDataCacheOnBetsAddedEventHandler(object sender, BetsAddedEventArgs betsAddedEventArgs)
        {
            var customerId = betsAddedEventArgs.CustomerId;
            Debug.Assert(_customerIdToCustomerLookup.ContainsKey(customerId));

            var customerViewModel = _customerIdToCustomerLookup[customerId];

            var betViewModels = betsAddedEventArgs.Bets.Select(bet => new BetDataViewModel(bet, customerViewModel)).ToList();

            // todo - don't do this
            Application.Current.Dispatcher.Invoke(() =>
            {
                foreach (var betViewModel in betViewModels)
                {
                    customerViewModel.BetDataViewModels.Add(betViewModel);
                }
            });
        }
 private void FireNewBetsEvents(Dictionary<int, List<Bet>> newItemsDictionary)
 {
     foreach (var customerBets in newItemsDictionary)
     {
         var eventArgs = new BetsAddedEventArgs(customerBets.Key, customerBets.Value);
         OnBetsAdded(eventArgs);
     }
 }