private void Calendar()
        {
            lbDate.Content = _date.ToString("MMMM yyyy");
            spCalendar.Children.Clear();
            StackPanel spLine = new StackPanel();

            spLine.Orientation = Orientation.Horizontal;
            DateTime dateMonth = new DateTime(_date.Year, _date.Month, 1);
            int      daysCount = DateTime.DaysInMonth(_date.Year, _date.Month);

            for (int i = 0; i < daysCount; i++)
            {
                if (dateMonth.DayOfWeek == DayOfWeek.Monday && spLine.Children.Count > 0)
                {
                    spCalendar.Children.Add(spLine);
                    spLine             = new StackPanel();
                    spLine.Orientation = Orientation.Horizontal;
                }

                List <Tournament> dayTournaments = new List <Tournament>();
                foreach (Tournament t in Session.Instance.Game.kernel.Competitions)
                {
                    if (t.IsInternational() || Session.Instance.Game.kernel.LocalisationTournament(t) == Session.Instance.Game.club.Country())
                    {
                        foreach (Round r in t.rounds)
                        {
                            foreach (GameDay gd in r.programmation.gamesDays)
                            {
                                DateTime dt = gd.ConvertToDateTime(Session.Instance.Game.date.Year);
                                if (Utils.IsBeforeWithoutYear(dt, r.DateInitialisationRound()))
                                {
                                    dt = gd.ConvertToDateTime(Session.Instance.Game.date.Year + 1);
                                }
                                if (Utils.CompareDatesWithoutYear(dt, dateMonth))
                                {
                                    dayTournaments.Add(t);
                                }
                            }
                        }
                    }
                }

                spLine.Children.Add(ViewUtils.CreateCalendarItem(dateMonth, Utils.CompareDates(dateMonth, Session.Instance.Game.date), null, dayTournaments));

                dateMonth = dateMonth.AddDays(1);
            }
            spCalendar.Children.Add(spLine);
        }
 private void FillCalendar()
 {
     spCalendar.Children.Clear();
     for (int i = -3; i < 4; i++)
     {
         //TODO: Not efficient way (function in club if has a game this day ?)
         Match match = null;
         foreach (Match m in _partie.club.Games)
         {
             if (Utils.CompareDates(m.day, _partie.date.AddDays(i)))
             {
                 match = m;
             }
         }
         spCalendar.Children.Add(ViewUtils.CreateCalendarItem(_partie.date.AddDays(i), i == 0, match));
     }
 }