private void MatchLoaded(object sender, RoutedEventArgs e) { // Initialisation des Matchs BusinessLayer.JediTournamentManager jtm = new BusinessLayer.JediTournamentManager(); List <EntitiesLayer.Match> matchs = jtm.getMatchsNonEmpty(); ViewModel.Match.MatchsViewModel mvm = new ViewModel.Match.MatchsViewModel(matchs); ucMatchs.DataContext = mvm; }
private void MatchUnloaded(object sender, RoutedEventArgs e) { BusinessLayer.JediTournamentManager jtm = new BusinessLayer.JediTournamentManager(); ViewModel.Match.MatchsViewModel mvm = ucMatchs.DataContext as ViewModel.Match.MatchsViewModel; List <EntitiesLayer.Match> matchs = new List <EntitiesLayer.Match>(); foreach (ViewModel.Match.MatchViewModel m in mvm.Matchs) { matchs.Add(m.Match); } matchs.AddRange(jtm.getMatchsEmpty()); jtm.updateMatches(matchs); }
public void SetDetails(object sender, EventArgs e) { if (BusinessLayer.PartieManager.getCurrentGame().Tournament != null) { List<EntitiesLayer.Match> ms = new List<EntitiesLayer.Match>(); foreach (EntitiesLayer.Match m in BusinessLayer.PartieManager.getCurrentGame().Tournament.Matchs) { if (m.Jedi1 != null && m.Jedi2 != null) ms.Add(m); } IList<EntitiesLayer.Match> matchs = ms; ViewModel.Match.MatchsViewModel mvm = new ViewModel.Match.MatchsViewModel(matchs); tournamentDetails.DataContext = mvm; } }
public void SetDetails(object sender, EventArgs e) { if (BusinessLayer.PartieManager.getCurrentGame().Tournament != null) { List <EntitiesLayer.Match> ms = new List <EntitiesLayer.Match>(); foreach (EntitiesLayer.Match m in BusinessLayer.PartieManager.getCurrentGame().Tournament.Matchs) { if (m.Jedi1 != null && m.Jedi2 != null) { ms.Add(m); } } IList <EntitiesLayer.Match> matchs = ms; ViewModel.Match.MatchsViewModel mvm = new ViewModel.Match.MatchsViewModel(matchs); tournamentDetails.DataContext = mvm; } }
private void MatchLoaded(object sender, RoutedEventArgs e) { // Initialisation des Matchs BusinessLayer.JediTournamentManager jtm = new BusinessLayer.JediTournamentManager(); List<EntitiesLayer.Match> matchs = jtm.getMatchsNonEmpty(); ViewModel.Match.MatchsViewModel mvm = new ViewModel.Match.MatchsViewModel(matchs); ucMatchs.DataContext = mvm; }