private void ConvertMatchesToButtons(SortableObservableCollection <IMatchVw> matches, SortableObservableCollection <VFLMatchButton> vflMatchButtons) { SortableObservableCollection <VFLMatchButton> buttons = new SortableObservableCollection <VFLMatchButton>(); int channel = 0; foreach (MatchVw match in matches.OrderBy(x => x.LineObject.BtrMatchId)) { VFLMatchButton button = new VFLMatchButton(match.HomeCompetitorName, match.AwayCompetitorName, match.LineObject.BtrMatchId, match); button.Channel = channel++; buttons.Add(button); } if (vflMatchButtons.Count != 0) { if (buttons.Count == 0) { vflMatchButtons.Clear(); } if (vflMatchButtons[0].MatchVw.VirtualDay != buttons[0].MatchVw.VirtualDay) { vflMatchButtons.Clear(); } } if (vflMatchButtons.Count == 0) { foreach (var vflMatchButton in buttons) { vflMatchButtons.Add(vflMatchButton); } vflMatchButtons.ElementAt(0).IsSelected = true; OnOpenVflPage(vflMatchButtons.ElementAt(0)); } }
public void Update(int row, int col, double newval) { //System.Diagnostics.Debug.Print("Update {0}, {1}, {2}", row, col, newval); if (_profile.Count > row) { Point p = _profile.ElementAt(row); if (col == 0) { p.X = newval; } else if (col == 1) { p.Y = newval; } _profile.RemoveAt(row); _profile.Insert(row, p); CreateOutline(); } }