private void initEntries(string correct, string init, List <string> options) { Options = new List <RadioEntry>(); foreach (string option in options) { var entry = new RadioEntry(option, option.Equals(init)); entry.EntrySelected += handleSelectedChanged; Options.Add(entry); } this.correct = Options.Where(o => o.Value.Equals(correct)).FirstOrDefault(); this.init = Options.Where(o => o.Value.Equals(init)).FirstOrDefault(); }
private void handleSelectedChanged(object sender, RadioEntry entry) { Options.ForEach(o => o.Selected = o.Equals(entry)); ControlChanged?.Invoke(this, new ClickEvent(this, entry.Value, DateTime.Now)); }