public TableGroupWin(List <UchastChamp> uchs, ChampionatConfig champ) { DataContext = champ; InitializeComponent(); Fill(0, uchs, ref u1Win, ref u1Win2); WinGroup1.Content = u1Win?.Uchastnick.Name; Place2WinGroup1.Content = u1Win2?.Uchastnick.Name; Fill(3, uchs, ref u2Win, ref u2Win2); WinGroup2.Content = u2Win?.Uchastnick.Name; Place2WinGroup2.Content = u2Win2?.Uchastnick.Name; }
public TableStat(ChampionatConfig conf) { InitializeComponent(); if (conf == null) { return; } var uchs = new SortedDictionary <int?, UchastChamp>(); foreach (var uch in conf.UchastChamps) { uchs.Add(uch.OrderNum, uch); } var luch = new List <UchastChamp>(); foreach (var u in uchs) { luch.Add(u.Value); } for (int i = 0, j = 1; i < 6; i += 3) { if (i > luch.Count - 1) { break; } var tb = new TbGroup() { conf = conf, OrderGroup = j++ }; tb.uch1 = luch[i]; if (luch.Count > i + 1) { tb.uch2 = luch[i + 1]; } if (luch.Count > i + 2) { tb.uch3 = luch[i + 2]; } gr.Children.Add(new TableGroup(tb)); } if (luch.Count > 3) { gr.Children.Add(new TableGroupWin(luch, conf)); } }
public void Update(ChampionatConfig champ) { sors = champ.Sorevnovanies.OrderByDescending(r => r.NumGroup).ToList(); current = -1; Next(); }