public override void PrepareForSegue(UIStoryboardSegue segue, Foundation.NSObject sender)
        {
            switch (segue.Identifier)
            {
            case "LeagueStat":

                var vc = segue.DestinationViewController as LeagueStatContainerViewController;
                vc.Players          = Players;
                vc.Teams            = Teams;
                vc.PlayerStatistics = PlayerStatisticsMaker.CreatePlayerStatistics(Statistics).OrderByDescending(s => s.Points);

                break;

            case "LeagueMatches":

                var vc2 = segue.DestinationViewController as LeagueMatchesViewController;
                vc2.Teams          = Teams;
                vc2.MatchesByRound = Matches.GroupBy(m => m.Round).Select(m => m.OrderBy(m1 => m1.Date).ToList()).ToList();

                break;

            case "LeagueTable":

                var vc1 = segue.DestinationViewController as LeagueTableContainerViewController;
                vc1.Teams = Teams;

                break;


            default:
                break;
            }
        }
Esempio n. 2
0
        protected override void InitProperties()
        {
            base.InitProperties();

            League           = Intent.GetObject <League>("league");
            Teams            = UoW.TeamRepo.GetTeamsByLeague(League.Id);
            Matches          = UoW.MatchRepo.GetMatchesByLeague(League.Id);
            Statistics       = UoW.StatiscticRepo.GetStatisticsByLeague(League.Id);
            PlayerStatistics = PlayerStatisticsMaker.CreatePlayerStatistics(Statistics);
            Players          = UoW.PlayerRepo.GetPlayersByLeague(League.Id);
        }
        public override void RowSelected(UITableView tableView, Foundation.NSIndexPath indexPath)
        {
            var league = LeaguesByCountry.ElementAt(indexPath.Section).ElementAt(indexPath.Row);

            var vc = Storyboard.InstantiateViewController("LeagueViewController") as LeagueViewController;

            vc.League           = league;
            vc.Teams            = AppDelegate.SharedAppDelegate.UoW.TeamRepo.GetTeamsByLeague(league.Id);
            vc.Matches          = AppDelegate.SharedAppDelegate.UoW.MatchRepo.GetMatchesByLeague(league.Id);
            vc.Statistics       = AppDelegate.SharedAppDelegate.UoW.StatiscticRepo.GetStatisticsByLeague(league.Id);
            vc.PlayerStatistics = PlayerStatisticsMaker.CreatePlayerStatistics(vc.Statistics);
            vc.Players          = AppDelegate.SharedAppDelegate.UoW.PlayerRepo.GetPlayersByLeague(league.Id);

            ParentViewController.NavigationController.PushViewController(vc, true);
        }