private void UpdateVendorValue(OutcomeSelectedMessage message) { OddsItemViewModel ow = (OddsItemViewModel)message.Sender; Match match = GetMatch(ow.Odds.MatchId); if (!matchOutcomes.ContainsKey(match)) { matchOutcomes.Add(match, message.OutcomeType); } else if (!matchOutcomes[match].Equals(message.OutcomeType)) { matchOutcomes[match] = message.OutcomeType; } else { matchOutcomes.Remove(match); } VendorValue = _comboCalcService.CalculateCombination(matchOutcomes); if (VendorValue.Value != 0) { IsComboResVisible = true; } else { IsComboResVisible = false; } }
public async void GetMatchesFromDataServiceAsync(int compId) { matchList = await _matchDataService.GetMatchesByCompetitionIdAsync(compId); foreach (var m in matchList) { MatchHeader currMatchHeader = new MatchHeader(m); foreach (Odds o in m.Odds) { OddsItemViewModel ow = new OddsItemViewModel(o, Messenger); currMatchHeader.Add(ow); } Matches.Add(currMatchHeader); } }
public void Init(string compName, int compId) { IsComboResVisible = false; CompName = compName; Matches = new MvxObservableCollection <MatchHeader>(); //GetMatchesFromDataServiceAsync(compId); matchList = _matchDataService.GetMatchesByCompetitionId(compId); foreach (var m in matchList) { MatchHeader currMatchHeader = new MatchHeader(m); foreach (Odds o in m.Odds) { OddsItemViewModel ow = new OddsItemViewModel(o, Messenger); currMatchHeader.Add(ow); } Matches.Add(currMatchHeader); } }